Code Quality · interview question
If you wrote a test around mypy feedback, what should the test prove first?
Multiple choiceMediumchapter-10-curatedpremiumcode-qualitymypy-feedback
def subtotal(lines: list[float]) -> float:
return sum(lines)Answer and explanation
Correct answer
A. 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 Quality
A free test with instant, explained results. No account needed.
More Code Quality questions
- What kind of contract clarity matters most for linters and formatters?
- What is the healthiest performance judgment around mypy feedback?
- Which naming or modeling choice is strongest for mypy feedback?
- What does a strong engineer do when reasoning through linters and formatters code?
- What is the healthiest performance judgment around linters and formatters?
- Which option treats mypy feedback as an engineering policy decision instead of a syntax trick?