Functions · interview question
Another engineer will maintain this code later. What choice helps the most around return values?
Multiple choiceMediumchapter-2-curatedpremiumfunctionsreturn-values
Answer and explanation
Correct answer
C. Make the rule obvious in names, flow, and boundaries so the next reader does not have to reverse-engineer your intent.
Why
Maintainability comes from explicit intent. Clear return values are a sign that you understand how information flows through the program.
Test yourself on Functions
A free test with instant, explained results. No account needed.
More Functions questions
- What does a strong engineer do when reasoning through return values code?
- Which judgment is strongest when choosing a data shape for return values?
- When is return values being used in the wrong way?
- What does a strong engineer do when reasoning through function extraction code?
- A teammate submits shaky function extraction code. Which review comment is the strongest?
- What is the healthiest performance judgment around function extraction?