Skip to content
Sharp

Code Reading · interview question

A bug appears around dry runs and rule narration. What is the strongest first debugging move?

Multiple choiceHardchapter-2-curatedpremiumcode-readingdry-runs-and-rule-narration
python
def preview_shipping(subtotal: float) -> str:
    if subtotal >= 100:
        return "free shipping"
    return "standard shipping"
Choose one answer
Answer and explanation

Correct answer

B. 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. Skipping narration hides misunderstandings until the wrong row or edge case appears.

Test yourself on Code Reading

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

Start free test
All Code Reading questions →