Skip to content
Sharp

Code Review · interview question

A bug appears around readability tradeoffs. What is the strongest first debugging move?

Multiple choiceHardchapter-8-curatedpremiumcode-reviewreadability-tradeoffs
python
totals = [
    row["unit_price"] * row["quantity"]
    for row in rows
    if row["status"] == "ready"
]
Choose one answer
Answer and explanation

Correct answer

A. Trace one concrete example, inspect the state transitions, and compare them to the intended rule before rewriting anything.

Why

That approach is reliable because it creates evidence. Compressing critical logic into one expression may impress for a second and then cost hours later.

Test yourself on Code Review

A free test with instant, explained results. No account needed.

Start free test
All Code Review questions →