Facebook Pixel
sum(1)(2)(3) Interview Tips for Amazon

What follow-up should I expect after solving sum(1)(2)(3)?

The answer

How would you support multiple arguments (sum(1, 2)(3)), how would you add other operations (multiply), how would you make it a generic curry, and what is the time/space complexity.

More FAQs in sum(1)(2)(3) Interview Tips for Amazon

Recognize it as currying. Start with the simple solution (terminate with empty call). Explain how closures accumulate the sum. Mention toString as an alternative. Handle follow-ups like multiple arguments.

Not returning a function (the chain breaks), not accumulating the previous value, no termination mechanism (no way to get the result), and overcomplicating (using classes or complex state instead of a simple closure).

Yes. After the basic solution, mention that you could also use toString or valueOf for automatic type coercion. This shows deeper JavaScript knowledge (type coercion, toString, valueOf).

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Your learning library

Small steps. Big possibilities.

Find your next course. Build something great.

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.