Fault Tolerance, High Availability, and Disaster Recovery Questions
Keeping a system serving despite failure, from code-level resilience to infrastructure-level recovery: circuit breakers, retries with backoff and jitter, timeouts, bulkheads, graceful degradation, and preventing cascading failures, alongside redundancy, failover (active-active versus active-passive), RPO and RTO objectives, backup and restore, and multi-region failover. Covers dependency-failure isolation, chaos engineering to validate resilience, failure-mode analysis, designing to nines of availability, cost-versus-availability tradeoffs, and recovery runbooks. Spans both the patterns that isolate partial failure and the disaster-recovery planning that restores a business-critical system after a major outage.
Design a chaos engineering program that progressively increases risk across service, database, and network layers for a critical system, starting with the safest experiments and working up. For each layer, what's your hypothesis, your blast-radius control, and your rollback criteria?
Sample Answer
Direct answer
Structure the program as a pyramid of increasing blast radius: start with single-instance, single-connection experiments in a canary slice of traffic, and only widen scope once the previous step stayed green. Every experiment, regardless of layer, needs the same three things stated up front: a falsifiable hypothesis (what should happen if the system is as resilient as you believe), a blast-radius control (the mechanism that caps how much traffic or infrastructure the experiment can touch), and a rollback criterion (the automated trigger that aborts the experiment before it becomes an incident).
Program structure by layer
| Layer | Hypothesis | Blast-radius control | Rollback criteria | Safest to riskiest experiments |
|---|---|---|---|---|
| Service | Losing a fraction of worker instances doesn't breach the SLO, because retries and circuit breakers absorb it | Canary AZ, capped at 1 to 5 percent of real traffic, feature-flag kill switch | Error rate more than 2x baseline AND p95 latency over SLO for 5 minutes, or success rate drops more than 1 percentage point absolute | (1) kill one non-primary worker process, (2) terminate 5 percent of workers in one AZ, (3) inject added latency into a canary slice, (4) disable retries on a canary path to check the fallback actually engages |
| Database | Read replicas and connection pooling keep reads available; write failures retry or queue without data loss | Target one replica or one connection pool at a time, throttle at the connection level, never touch the primary directly in early stages | Replication lag over a fixed threshold (for example 30 seconds), write failure rate spikes more than 1 percentage point absolute, or any detected data divergence | (1) throttle one read replica's I/O by 10 percent, (2) pause replication on one replica briefly, (3) close 5 percent of connections from a non-critical pool, (4) simulate primary failover, first in staging, then in a production canary |
| Network | Timeouts, retries, and the service mesh absorb transient network faults without payment (or equivalent critical-path) loss | Confine faults to one AZ and a capped traffic percentage using mesh-level fault injection, not a real router or switch | End-to-end success rate on the critical path drops more than 1 percentage point, or a circuit breaker stays open across more than 2 dependent services simultaneously | (1) add 50ms latency to one client-to-service hop, (2) inject 1 percent packet loss in one AZ for 5 minutes, (3) simulate a route flap between two internal services, (4) blackhole a non-critical downstream dependency and confirm graceful degradation, not failure |
The pyramid runs left to right within a layer, and layer to layer (service before database before network) because a service-level failure is the easiest to reason about and the cheapest to roll back; database and network faults touch more of the system at once and take longer to reverse cleanly.
Execution discipline
- Pre-flight: a written runbook, on-call and stakeholders notified, an automated abort mechanism wired to the rollback criteria (not a human watching a dashboard and deciding), and the experiment coded as a reproducible, version-controlled script rather than an ad hoc manual action.
- During: watch the rollback-criteria metrics in real time; the abort has to be automatic and fast, because by the time a human notices a metric crossing threshold and manually intervenes, the blast radius has often already grown past what the control was meant to cap.
- After: a lightweight postmortem regardless of outcome (a clean pass is still evidence worth recording), and only widen scope for the next run once the current one is unambiguously green, not "green with an asterisk."
Trade-offs & pitfalls
The single most common mistake is skipping straight to a production-wide experiment because a staging environment "doesn't reproduce the failure mode," which is often true but doesn't change the fact that the first production run of any new fault type belongs in the smallest blast radius you can construct, even if that means accepting a less realistic signal initially. A second pitfall is defining rollback criteria in terms of the fault itself (for example, "abort if packet loss exceeds 2 percent") instead of user-facing impact (error rate, latency, success rate); the fault is the input you're controlling, the rollback trigger has to watch the output, or you can hit exactly your intended fault level while still causing an unacceptable customer-facing outage. Not every fault type generalizes across domains the same way either: a GPU training job's most dangerous failure mode isn't a crashed worker (checkpointing handles that cheaply) but silent numerical divergence (the training job keeps running, but silently starts computing mathematically wrong updates to the model, with no crash or error to announce it), where the job keeps running and producing wrong gradients (a gradient is the per-step adjustment the training process makes to the model's internal numbers; a wrong one nudges the model in a bad direction instead of a good one) with no immediate error signal, so the safe blast-radius control there is different in kind from an HTTP service's traffic-percentage cap: it's about capping how long a divergence can run undetected before an automated metric check, watching a loss curve (a plot of the model's error over time, which should trend down) or a gradient norm (a single number summarizing how large the model's updates are; a sudden spike signals training has gone unstable), kills the job, not about capping how many requests are affected. A resilience program that only ever tests one fault type at a time also under-tests: real incidents are frequently two failures at once (a network blip during a deploy, a slow dependency during a traffic spike), so a mature program's later stages deliberately combine fault types once single-fault experiments across all three layers are consistently passing.
Staff-level: propose an enterprise resilience strategy for handling dependency failures across hundreds of services and multiple third-party APIs. Cover reusable patterns, governance, telemetry, runbooks, and how you'd prioritize the fastest reduction in customer impact given an existing high-MTTR baseline.
Sample Answer
Direct answer
At hundreds-of-services scale, resilience can't be a per-team decision made independently for each service, because the inconsistency itself becomes the risk: one team's excellent circuit-breaker tuning doesn't help if the team three hops upstream never implemented one at all. The strategy has four layers that reinforce each other: reusable patterns shipped as shared libraries so teams don't reinvent (and mis-implement) the same primitives, governance that makes resilience a gate rather than a suggestion, telemetry that gives every team and the org as a whole a common picture of dependency health, and runbooks that turn "we know this failure mode exists" into "here's exactly what an on-call engineer does about it at 3am." Given an existing high-MTTR baseline, the fastest reduction in customer impact rarely comes from writing more resilience code first; it comes from instrumenting what's actually failing today and fixing the highest-blast-radius gaps, because at this scale intuition about "which dependency is riskiest" is usually wrong.
Reusable patterns
Ship standardized client libraries (one per major language in use) that implement the standard resilience toolkit for calling another service: something to stop hammering a dependency that's already failing, something that spaces out and caps retries so they don't pile on, something that enforces how long a call is allowed to wait, and something that stops one slow dependency from exhausting resources other calls need. (Named precisely, for readers who want the specific patterns: circuit breakers, jittered exponential backoff with retry budgets, timeout and deadline propagation, and bulkhead-style connection pooling.) Ship these as versioned SDKs or a sidecar proxy (a small helper process deployed alongside the service, in its own container but sharing the same host or pod, that intercepts outbound network calls and applies the retry/timeout/circuit-breaker logic on the service's behalf, so the service's own code doesn't have to implement the pattern itself) for languages that can't easily share a library. The goal isn't just code reuse, it's that every team's circuit breaker behaves the same way under the same conditions, so an incident responder who understands one service's failure behavior can reason about any other service's failure behavior too. A pattern catalog with runnable examples for each pattern (service-to-service versus third-party dependency, since third parties often need more conservative defaults) makes correct usage the path of least resistance.
Governance
| Mechanism | What it enforces |
|---|---|
| SLI/SLO declaration per service (SLI: the metric you measure, like latency or success rate; SLO: the target you commit to for that metric) | Every service that calls another declares what it needs (latency, success rate) from that dependency, making implicit expectations explicit and auditable |
| Architecture review gate | New services and new external integrations pass a resilience checklist (timeouts set, retries bounded, circuit breaker present) before launch, not retrofitted after an incident |
| Third-party vetting checklist | New vendor integrations are assessed for SLA terms, documented retry/rate-limit behavior, and escalation contacts before the integration ships, since a third-party outage is not something your own SDK can fully protect against |
| CI-enforced lint rules | Timeouts, bounded retries, and SLO annotations are checked automatically at merge time, catching the class of bug where a developer forgot a timeout entirely rather than relying on code review to catch it |
Telemetry
Every SDK emits standardized telemetry (circuit-breaker state transitions, retry counts, latency histograms, per-dependency error codes) into a shared observability stack, feeding a small number of org-wide dashboards: a dependency heatmap showing which services are the riskiest single points of failure by fan-in (the number of other services that call into this one; a high fan-in means many things break at once if it fails), a per-service SLO burn-rate view, and a "top failing third parties" view that surfaces vendor issues before they've caused five separate team-level incidents that nobody connected. Alerting on SLO burn rate and on sudden spikes in open-circuit count catches emerging problems before they cascade, rather than after an incident is already customer-visible.
Runbooks
Per-dependency runbooks covering detection, mitigation (force-close or force-open a circuit, apply emergency throttling, shift traffic to a degraded mode), rollback, and escalation contacts, with the common actions automated (a CLI or button to toggle a circuit breaker, not a manual code deploy) so response time doesn't depend on someone remembering the right kubectl incantation under pressure. Runbooks that are only tested during real incidents are unreliable; quarterly tabletop exercises (a facilitated walkthrough where the on-call team talks through their response to a scripted incident scenario out loud, step by step, without touching any real production system) simulating a specific third-party outage validate that the documented steps actually work and that the on-call rotation knows where to find them.
Prioritizing remediation against a high-MTTR baseline
Given limited engineering time, the fastest reduction in customer impact comes from ranking services by (fan-in × current failure rate × missing-resilience-pattern count), not by which team is loudest or which service feels intuitively risky. Tracing the formula through a small, illustrative example makes the ranking concrete: Service X has fan-in 50, a current failure rate of 2% (0.02), and 3 missing resilience patterns, scoring 50×0.02×3=3.0; Service Y has fan-in 5, a much higher failure rate of 10% (0.10), but only 1 missing pattern, scoring 5×0.10×1=0.5; Service Z has fan-in 200, a low failure rate of 0.5% (0.005), and 2 missing patterns, scoring 200×0.005×2=2.0. Ranked by score, the fix order is X (3.0), then Z (2.0), then Y (0.5), even though Y's raw failure rate is the highest of the three, because Y's small blast radius (only 5 callers) and already-thin gap list make it a low-leverage fix by comparison. A service with 50 upstream callers and no circuit breaker is a much higher-leverage fix than a service with 2 callers and a full resilience suite already in place, even if the second service "feels" more important because it's customer-facing. Concretely: instrument telemetry first (you can't rank what you can't see), fix the highest fan-in gaps first (biggest blast-radius reduction per engineering-hour), and treat "ship the shared SDK" and "mandate its use via the architecture-review gate" as sequential, not simultaneous, since a library nobody's required to adopt doesn't move the MTTR number regardless of how good it is.
Trade-offs & pitfalls
Uniform SDK adoption is the ideal, but legacy or polyglot systems make a single shared library impractical everywhere; a sidecar-proxy approach extends the same governed behavior to services that can't easily embed the SDK, at the cost of an extra network hop and an additional piece of infrastructure to operate. Mandating resilience patterns through architecture-review gates works for new services but does nothing for the hundreds of already-shipped services that predate the gate, so rollout has to include a deliberate retrofit plan (again, prioritized by the fan-in ranking above) rather than assuming the gate alone will fix the fleet over time. The biggest governance failure mode at this scale is treating the checklist as a one-time approval rather than a continuously monitored property. A service that passed its architecture review with a correctly-configured circuit breaker two years ago can silently regress (a config change, a library version bump that changed defaults) with nobody noticing until the next incident, which is exactly what the telemetry layer's continuous SLO-burn alerting is meant to catch that a point-in-time review cannot.
Not every service in your portfolio needs the same level of redundancy. Walk through how you'd tier services (say critical, important, noncritical) and what redundancy level and SLO target you'd assign to each tier, and why.
Sample Answer
Direct answer: Not every service deserves the same redundancy budget, because redundancy costs money and operational complexity that only pays off if the service's failure actually hurts the business. I'd tier services by blast radius (does it touch revenue, does it touch customer trust, is there a regulatory SLA) rather than by how technically interesting the service is, and assign each tier a concrete SLO (service level objective: the target reliability number the team commits to hitting, e.g. 99.9% uptime), redundancy model, and error budget derived from that SLO, not an arbitrary one.
Structured elaboration: a three-tier model
| Tier | Example services | SLO target | Redundancy model | Monthly error budget |
|---|---|---|---|---|
| Critical | Checkout, auth, payment processing | 99.99% | Active-active across 2+ regions, automated failover | (1−0.9999)×730×60=4.38 min |
| Important | Search, recommendations, internal APIs other teams depend on | 99.9% | Active-passive cross-region or multi-AZ single region, automated failover | (1−0.999)×730×60=43.8 min |
| Noncritical | Internal admin tools, batch analytics, nightly reports | 99.0% | Single-region, autoscaled, manual recovery acceptable | (1−0.99)×730×60=438 min (≈ 7h 18m) |
The error budget column isn't asserted, it's derived from the SLO the same way allowed downtime is derived from an availability target: budgetmonth=(1−A)×730×60 minutes. Notice the tiers are roughly 10x apart from each other in budget (4.38 to 43.8 to 438 minutes), which mirrors the 10x-per-nine relationship and makes the tiers easy to reason about and communicate.
How I'd assign a service to a tier:
- Revenue/legal impact: does an outage stop money from moving, or breach a contractual SLA? If yes, floor is Critical regardless of traffic volume.
- Blast radius to other teams: is this a shared dependency other services call synchronously? A "low traffic" internal auth service can still deserve Critical tier because everything downstream inherits its outage.
- User-facing vs. internal: internal tools default one tier lower than an equivalent customer-facing service, unless (2) applies.
- Recoverability: if a noncritical batch job fails, does it self-heal on the next run with no lasting damage? If yes, it can sit at 99% even if "important" sounding, because the cost of a missed run is low.
Worked example applying the model: a checkout service (Critical, 99.99%, active-active) calls a recommendations service (Important, 99.9%) for a "customers also bought" widget. If recommendations goes down, checkout's tier assignment only holds if checkout is built to degrade gracefully when that dependency fails (skip the widget, keep processing the order), rather than blocking checkout on it. This is the practical reason tiering isn't just about the service itself, it forces you to also classify every dependency edge as "must be up for me to meet my SLO" or "nice to have," which is often the more useful output of the exercise than the tier label itself.
Trade-offs & pitfalls
- Over-tiering (calling too many services Critical) defeats the purpose: if everything is active-active multi-region, you've spent the budget without actually differentiating risk, and you've made the org slower to ship everywhere instead of faster where it doesn't matter.
- Tiers need a review cadence. A service that started as an internal tool and quietly became load-bearing for a customer-facing flow needs to be re-tiered; without a periodic review, tier assignments rot and stop reflecting actual blast radius.
- Political pressure to over-tier is common (every team believes their service is critical); the fix is grounding tier assignment in the revenue/legal/blast-radius questions above with a named approver, not a self-declared label.
- A common wrong turn: tiering the service but not its dependencies. A Critical-tier service that synchronously calls a Noncritical-tier dependency on its hot path has effectively downgraded itself to the dependency's tier, no matter what its own SLO document says.
Explain active-active versus active-passive architecture. For each, walk through the typical failover behavior, what it takes to detect a failure, and when you'd choose one over the other.
Sample Answer
Active-active runs all nodes or regions serving live traffic at the same time, so failover is mostly a routing problem: stop sending traffic to the unhealthy node. Active-passive keeps one side idle (or partially warmed) as a standby, so failover is a promotion problem: detect the primary is down, make the standby the new primary, then redirect traffic to it. That difference in what has to happen during failover is what drives everything else: recovery speed (RTO, recovery time objective: how long it takes to restore service after a failure), data-consistency risk (RPO, recovery point objective: how much data, measured in time, you could lose in a failure), and cost.
Comparing the two
| Dimension | Active-active | Active-passive |
|---|---|---|
| What's serving traffic | All nodes/regions, concurrently | Only the primary; standby is idle or warm |
| Failure detection | Health checks per node feed a load balancer or GSLB (Global Server Load Balancer: a DNS-based load balancer that routes traffic across regions, not just across servers in one place), which simply stops routing to the failed one | Health checks must trigger an explicit promotion decision, usually with a consensus/quorum step to avoid promoting during a false alarm |
| What "failover" does | Reroute traffic; no state transition needed | Promote replica to primary, update routing (DNS or LB config), then reroute traffic |
| Typical RPO | Near-zero if writes are synchronously replicated or conflict-resolved; otherwise bounded by replication lag | Near-zero with a synchronous standby, up to minutes with an async one |
| Consistency risk | Needs conflict resolution or partitioned ownership if writes happen on both sides (dual-writer problem) | Simpler: single writer at any point in time, no conflict resolution needed |
| Cost/complexity | Higher: full capacity running everywhere, plus distributed-write tooling | Lower: standby can run at reduced capacity (or be provisioned only at failover time) |
| Best fit | Latency-sensitive, globally distributed traffic; teams that can invest in multi-writer data patterns | Systems needing a single source of truth for writes (most transactional relational databases); cost-sensitive setups |
Worked example: deriving RTO for each
Pin the same detection policy to both: a health check runs every 5 seconds, and 3 consecutive failures are required before the system acts (15 seconds to declare a node down; this avoids reacting to a single dropped probe).
Active-active RTO: once the node is declared down, the load balancer or GSLB removes it from rotation immediately (no promotion step). If we assume that rotation update takes about 5 seconds to propagate to all edge/LB nodes:
RTOactive-active≈15s (detect)+5s (reroute)=20 secondsActive-passive RTO: the same 15 seconds to detect, plus a promotion step (electing the standby, replaying any un-applied log entries, opening it for writes, say 20 seconds for a warm standby with low replication lag) plus DNS or routing propagation (assume a low TTL of 30 seconds, and worst case the full TTL has to expire before every client picks up the change):
RTOactive-passive≈15s (detect)+20s (promote)+30s (routing propagation)=65 secondsUnder these pinned assumptions, active-active recovers about 3x faster, entirely because it skips the promotion step, and that gap only grows if the standby is cold rather than warm (add provisioning time) or if the routing layer is DNS with a high TTL instead of a fast health-checked LB.
Trade-offs and pitfalls
Active-active's speed advantage is real but not free: the moment two regions can both accept writes to the same record, you have a distributed-write problem, and skipping it (assuming replication will "just" reconcile) is the most common wrong turn. It needs either a conflict-resolution strategy (last-write-wins with vector clocks, CRDTs) or partitioned ownership (each region owns a disjoint key range) to avoid silently losing or corrupting data during a partition. Active-passive's failure mode is different: over-eager health checks or a flapping network link can trigger a premature promotion while the old primary is still technically reachable by some clients, producing two nodes that both believe they're primary (split-brain), which is why production active-passive systems add fencing (forcibly cutting off the old primary's access to shared storage) on top of the detection logic above, not just a timer. The same trade-off shows up outside a classic web/DB stack too: failing over an ML-serving fleet is closer to active-active in spirit (multiple replicas of the same model serving concurrently, so losing one just drops capacity) unless the model itself is being hot-swapped, in which case the promotion-style risk (serving from a half-loaded or stale model version) reappears.
Leadership wants to cut cloud costs by 30% without dropping below 99.99% uptime for critical services. Walk through how you'd find the savings and what you'd protect no matter what.
Sample Answer
Direct answer
Frame the cut through the 99.99% error budget, not a blanket percentage. 99.99% allows about 52.6 minutes of downtime a year; anything that doesn't touch the paths that consume that budget is safe to cut aggressively, and anything that does must be modeled against it explicitly before you touch it. In practice that means chasing waste and inefficiency hard (usually most of the 30%), and treating redundancy, failover paths, and DR test cadence as protected unless you can show the specific budget impact is acceptable.
A three-bucket framework for the savings
D99.99%=(1−0.9999)×525600 min=52.56 min/yrThat number is the currency every cut gets priced in.
| Bucket | Examples | Availability impact |
|---|---|---|
| 1. Waste elimination | Idle/overprovisioned instances, orphaned disks/snapshots/IPs, unscheduled non-prod environments | None, doesn't touch the serving or failover path |
| 2. Efficiency gains | Rightsizing with headroom preserved, reserved/spot capacity for stateless, replaceable workers, caching hot reads | Neutral to positive if done with canary rollout and autoscaling guardrails |
| 3. Structural changes | Fewer replicas, longer failover windows, single cloud/provider consolidation, reduced DR test cadence | Directly spends the 52.6 min/yr error budget, must be modeled before approval |
Chase bucket 1 and 2 first and aggressively (they rarely conflict with availability); only reach into bucket 3 if 1 and 2 don't get you to 30%, and price every bucket-3 cut against the budget above.
Worked example
Suppose an audit of monthly compute spend of $300,000 finds 15% idle or overprovisioned capacity, plus another 10% recoverable through rightsizing and reserved commitments on stateless, replaceable capacity:
wasterightsizingsubtotal=$300,000×0.15=$45,000/mo=$300,000×0.10=$30,000/mo=$45,000+$30,000=$75,000/mo=25% of spendThat's 25 of the 30 points from buckets 1 and 2 alone, with essentially zero availability risk. The remaining 5 points has to come from bucket 3, for example dropping a redundant standby from 3 independent paths to 2 on some service. Whether that's safe depends entirely on whether that service is in the 99.99% critical scope. Reusing the same series/parallel redundancy model above (an N-way redundant path's unavailability is the product of each independent unit's own unavailability, since all N units have to fail at the same time for the whole path to be down: UN=(1−a)N), for a building block at a=0.99:
N=3:N=2:U3=(0.01)3=0.000001⇒D3=0.000001×525600=0.5256 min/yrU2=(0.01)2=0.0001⇒D2=0.0001×525600=52.56 min/yrDropping that one path from N=3 to N=2 raises its expected downtime contribution from about half a minute a year (0.5256 min/yr) to 52.56 minutes a year, a 100x jump that would consume the entire annual budget for the 99.99% target on that one path alone. That's the concrete argument for why redundancy counts on in-scope critical services are protected regardless of the cost target: the math shows the cut doesn't save what it looks like it saves once you price the risk.
Trade-offs and pitfalls
The classic failure is applying a flat 30% cut across the board instead of segmenting critical from non-critical, which either misses easy wins in non-critical systems or, worse, quietly erodes redundancy on a critical path because nobody explicitly modeled the budget impact. Watch for Goodhart's-law style gaming too: cutting observability or alerting spend looks free on the invoice but raises mean time to detect, which inflates the effective downtime against the same budget without showing up as an "availability" line item until an incident hits. What to protect no matter what: replica or quorum counts below the tested minimum on in-scope services, cross-region failover paths, backup and DR test cadence, and on-call staffing, because all four either directly hold the redundancy math above or determine how fast you can react when it fails.
Unlock Full Question Bank
Get access to all Fault Tolerance, High Availability, and Disaster Recovery interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.