Code Review · interview question
Which option is the safer default when shipping code around readability tradeoffs?
Multiple choiceHardchapter-8-curatedpremiumcode-reviewreadability-tradeoffs
totals = [
row["unit_price"] * row["quantity"]
for row in rows
if row["status"] == "ready"
]Answer and explanation
Correct answer
A. Choose the simpler shape that keeps the rule obvious, validated, and easy to observe in logs or tests.
Why
The safest default is usually the one that lowers ambiguity and makes errors easier to diagnose.
Test yourself on Code Review
A free test with instant, explained results. No account needed.
More Code Review questions
- What production risk should you worry about most if abstraction discipline is handled lazily?
- Another engineer will maintain this code later. What choice helps the most around readability tradeoffs?
- A senior interviewer asks for one tradeoff behind abstraction discipline. What is the strongest follow-up?
- When is review quality being used in the wrong way?
- What does a strong engineer do when reasoning through readability tradeoffs code?
- What kind of contract clarity matters most for abstraction discipline?