Bird
0
0

Consider this Node.js Lambda handler:

medium📝 Predict Output Q5 of 15
AWS - Lambda
Consider this Node.js Lambda handler:
exports.handler = async (event) => {
  console.log('Processing');
  return event.value + 10;
};

If event.value is 5, what is the output?
AError due to missing return
B'510'
C15
Dundefined
Step-by-Step Solution
Solution:
  1. Step 1: Understand event.value type and operation

    If event.value is number 5, adding 10 results in 15.
  2. Step 2: Confirm function returns the sum

    The function returns event.value + 10, so output is 15.
  3. Final Answer:

    15 -> Option C
  4. Quick Check:

    Number addition in Lambda = 15 [OK]
Quick Trick: Add numbers directly; strings concatenate differently [OK]
Common Mistakes:
MISTAKES
  • Assuming event.value is string causing concatenation
  • Expecting no return value
  • Confusing output with console.log

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes