Skip to content
Sharp

Code Reading · interview question

A bug appears around first mini project. What is the strongest first debugging move?

Multiple choiceMediumchapter-1-curatedpremiumcode-readingfirst-mini-project
python
def preview_shipping(subtotal: float) -> str:
    if subtotal >= 100:
        return "free shipping"
    return "standard shipping"
Choose one answer
Answer and explanation

Correct answer

C. 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. If the code only works when you are present to interpret it, the design is still weaker than it looks.

Test yourself on Code Reading

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

Start free test
All Code Reading questions →