Functions · interview question
A teammate submits shaky return values code. Which review comment is the strongest?
Multiple choiceMediumchapter-2-curatedpremiumfunctionsreturn-values
Answer and explanation
Correct answer
B. Make the rule clearer and easier to explain. A good return value lets the caller continue the workflow with a clear next piece of information.
Why
The best review comment anchors the change to readability, correctness, and future maintenance. Mutating external state for everything makes the control flow harder to test and harder to explain.
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?