Interview's MateSystem Design
Interview's Mate

System Design

Architecture & trade-offs

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
System Design topics
Lesson 25/ 31
Reliability, Security & Case Studies

Resilience & Fault Tolerance

Contain partial outages with timeouts, jittered retries, circuit breakers, and load shedding.

IntermediateCircuit Breaker · Backoff · Bulkhead3 quiz questions0/2 subtopics done
Practice in AI HLD
In plain wordsDiagramTheorySubtopics (2)Step by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice
Deep-dive subtopics (2) - 0/2 completed
Circuit Breakers, Bulkheads & Graceful Degradation

Stop one failing microservice from draining threads across your whole platform.

Intermediate
Retries, Exponential Backoff & Jitter

Retry transient glitches safely without triggering synchronized retry storms.

Beginner

In plain words

Resilience patterns stop one failing part from bringing down everything else, the way a fuse protects a house’s wiring.

Think of it like…

Electrical circuit breakers in a house: when one appliance shorts out, the breaker trips instantly to protect the whole house wiring from catching fire.

Where you’ve seen it

If the recommendations service is down, Amazon still shows the product page with a generic list instead of failing the whole page.

Words you’ll hear

Timeout
Give up on a call after a set time instead of waiting forever.
Retry with backoff
Try again, waiting longer each time, with some randomness (jitter).
Circuit breaker
Stop calling a failing service for a while so it can recover.
Bulkhead
Separate resource pools so one overloaded part can’t starve others.

Visual diagram

Loading interactive diagram
Loading interactive exercise

Theory & deep dive

How cascading failures take down entire companies

Imagine your Recommendations service freezes and starts taking 30 seconds instead of 20 ms. If your Product Page service calls it with no timeout (or a 60s timeout) and retries 3 times, all web worker threads quickly get stuck waiting on Recommendations - and soon login, cart, and checkout crash too!

Resilience patterns isolate blasts: Timeouts cap every call, Circuit Breakers stop calling a dead dependency and serve a graceful fallback, Bulkheads keep separate thread pools per dependency, and Load Shedding drops low-priority traffic before the ship sinks.

Key takeaway: Every single network call needs a bounded timeout, capped retries with exponential backoff + jitter, and a circuit breaker.

How it works, step by step

Step 1 of 4
Timeout Budget

1. Enforce strict timeouts everywhere

Never make an HTTP/DB/RPC call with an infinite timeout. Propagate end-to-end request deadlines so a caller stops work once the client already timed out.

No infinite waits - fail fast and free resources
Key numbers at this step
Connect Timeout
100–500 ms
RPC Deadline
Propagated

When to use it & trade-offs

What it is

Resilience patterns stop a slow or failing dependency from cascading and taking down the entire application.

Why it matters: In distributed systems, slow dependencies are worse than fast crashes: hanging threads exhaust pools and cause domino-effect outages across every upstream caller.

When to reach for it

  • Wrapping third-party APIs (Stripe, Twilio, OAuth providers) in timeouts + circuit breakers
  • Serving stale cached data or generic fallbacks when personalization services degrade
  • Priority-based load shedding (protect checkout & login; shed analytics/previews first)

When to avoid or be careful

  • Retrying aggressively at 3 nested layers simultaneously (3 × 3 × 3 = 27× traffic amplification!)
  • Retrying non-idempotent POST requests without an Idempotency-Key

Core Fault-Tolerance Mechanisms

Exponential Backoff + Full Jitter
Best for: Transient network blips, rate-limit 429s, brief leader failovers

Strengths: Spreads retry attempts smoothly instead of hammering at the exact same millisecond.

Watch out: Retrying non-idempotent writes or retrying through an already overloaded tier worsens outages.

Circuit Breaker
Best for: Protecting callers when a downstream service is degraded or timing out

Strengths: Turns 5-second timeout hangs into <1 ms fast-fails with clean fallbacks.

Watch out: Requires careful threshold tuning so brief blips do not false-trip.

Bulkhead + Graceful Degradation
Best for: Mixed-criticality pages (Checkout vs. Personalized Recommendations)

Strengths: If the ML recommender hangs, Checkout still completes at 100% speed.

Watch out: Adds separate thread/connection pool sizing and fallback UI states.

Interview signals & numbers to know

When this topic comes up

  • cascading failure
  • third-party downtime
  • retry storm
  • graceful degradation
  • circuit breaker

Benchmarks & rules of thumb

Retry amplification (3 layers × 3) -
Up to 27× load
Circuit breaker error trip -
e.g. >50% over 20 reqs
Half-open cooldown -
15–60 seconds
Load shedding status -
503 Service Unavailable

Common mistakes & follow-ups

Common interview mistakes

  • Retrying 400 Bad Request or 401 Unauthorized (client bugs never heal on retry)
  • Omitting jitter from exponential backoff (every failed client wakes up at the exact same second)
  • Letting a slow optional widget (e.g., “Related items”) share a thread pool with core login/checkout

Likely interviewer follow-ups

  • Why is a slow hanging dependency often more dangerous than one that crashes immediately?
  • Explain retry amplification across 3 microservice layers and how retry budgets prevent it.
  • How do you design graceful degradation for an e-commerce homepage during Black Friday spikes?
Interview tip: Remember the golden rule of retries: only retry transient errors on idempotent calls, with exponential backoff, jitter, and a cap.

Knowledge check

Loading quiz

Put it into practice

Design full architectures with AI feedback

Apply Resilience & Fault Tolerance inside real High-Level Design prompts or review Q&A flashcards.

Open AI HLD Practice →SD Interview Q&A
Previous topic
High Availability & Failover
Next topic
Rate Limiting & Throttling