Code Reading · interview question
If you wrote a test around first mini project, what should the test prove first?
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
D. That the rule behaves correctly at the boundary cases the lesson is trying to make explicit.
Why
Good tests make the design safer to change because they lock in the meaningful behavior rather than surface-level implementation details.
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?