Functions · interview question
What assumption should be made explicit when working with return values?
Multiple choiceMediumchapter-2-curatedpremiumfunctionsreturn-values
Answer and explanation
Correct answer
B. The expected data shape, boundary rule, or invariant that the rest of the code depends on staying true.
Why
Once assumptions are explicit, bugs are easier to detect and test cases are easier to design.
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?