Reliability · interview question
If you wrote a test around failure policy, what should the test prove first?
Multiple choiceHardchapter-5-curatedpremiumreliabilityfailure-policy
def should_retry(status_code: int) -> bool:
return status_code in {429, 502, 503, 504}Answer and explanation
Correct answer
C. 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 Reliability
A free test with instant, explained results. No account needed.
More Reliability questions
- Which boundary choice best fits failure policy in a maintainable Python system?
- Which option describes the most likely pitfall around failure policy?
- What is the clearest sign that code around failure policy should be refactored?
- A teammate submits shaky failure policy code. Which review comment is the strongest?
- A bug appears around failure policy. What is the strongest first debugging move?
- Which explanation would sound strongest in an interview when discussing failure policy?