Resilience tests verify behavior when dependencies fail, slow down or return partial results. Define expected user outcomes before injecting failure.
Before you start
You should understand HTTP, database transactions and the difference between one process and independently failing services. Draw the participants and message direction before choosing a pattern. Include timeout, duplicate delivery and recovery in the model instead of considering only successful requests.
The practical goal is to reason through this situation: Delay inventory responses and confirm checkout respects its deadline. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.
Step-by-step walkthrough
Step 1: Define expected outcomes
Decide what users should see during the fault before injecting it.
Step 2: Bound the experiment
Use an isolated scope and explicit duration with observation and recovery criteria.
Step 3: Assert cleanup and recovery
Check resources and restored service, not only the initial rejection.
Worked scenario
Delay inventory responses and confirm checkout respects its deadline.
Inventory responses are delayed beyond checkout’s deadline. Checkout should return its controlled outcome, stop owned work and avoid saturating the shared pool. When the delay is removed, traffic should recover without a growing queue of obsolete requests. Steady-state load alone cannot establish those properties.
Common mistake
A successful steady-state load test says little about recovery under cascading failures.
Verify the behavior
Measure deadlines, resource counts and recovery time under the controlled fault.
Interview exercise
Test a dependency outage.
Answer and reasoning
Use an isolated environment, bounded fault scope and observable assertions for rejection, recovery and resource cleanup.
Continue learning
Compare the scenario with the Microservices interview questions and test your understanding with the Microservices MCQs. For terminology and implementation details, consult the reference material.