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
def preview_shipping(subtotal: float) -> str:
if subtotal >= 100:
return "free shipping"
return "standard shipping"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.
More Code Reading questions
- Which judgment is strongest when choosing a data shape for first mini project?
- Which boundary choice best fits first mini project in a maintainable Python system?
- When is first mini project being used in the wrong way?
- Which explanation would best help the team align on first mini project?
- Which option treats first mini project as an engineering policy decision instead of a syntax trick?
- Which option treats dry runs and rule narration as an engineering policy decision instead of a syntax trick?