Circuit Breakers: Follow-Up Questions Interviewers Ask (and How to Answer)
Interviewers ask follow-up questions after you mention circuit breakers because they want to see whether you treat them as a checklist item or as a core reliability mechanism. They also want to gauge how you think about the broader impact on latency, cost, and observability.
A solid answer shows you understand the failure modes you’re protecting against, the knobs you can tune, and how you would verify that the breaker behaves as expected in production.
Why circuit breakers matter in design interviews
Circuit breakers are a concrete way to demonstrate defensive architecture. They let you isolate flaky downstream services, keep latency predictable, and give you a clear metric to monitor. In an interview, they serve as a proxy for your overall approach to fault tolerance and graceful degradation.
Typical follow-up questions (from basic to advanced)
1. What state does a circuit breaker track, and how often is it updated?
I would say: "A breaker tracks three states—Closed, Open, and Half-Open. In the Closed state we count recent failures; once the failure rate exceeds a threshold (for example, 5 % over the last 100 requests), we transition to Open. The failure count is updated on every request response, typically using a sliding-window counter stored in memory. In Open we set a timer, often 30 seconds, after which we move to Half-Open and let a single request test the downstream again."
2. How do you choose the failure-rate threshold and the request-volume window?
I would answer: "The threshold should reflect the downstream’s SLA and the impact of its failures. It has to sit well above the downstream’s normal error rate, so for a service that normally fails well under 1 % of calls, a threshold between 5 % and 50 % (a common library default) is reasonable. The request-volume window is a trade-off between sensitivity and stability; a common choice is 100–200 requests, which at 10 RPS gives a window of 10–20 seconds. This balances quick reaction to real problems while avoiding flapping on transient spikes."
3. What latency metric do you use to decide when to open the breaker?
I would say: "Besides error rate, many teams add a latency guard. If the 95th-percentile latency exceeds a target—say 200 ms for a service whose normal latency is 50 ms—we treat those slow responses as failures. This prevents a downstream that is still returning HTTP 200 but is too slow from choking the caller."
4. How do you handle different error codes (e.g., 5xx vs. 4xx) in the failure count?
My answer: "Typically we count 5xx, timeouts, and network errors as failures because they indicate a problem on the server side or in the path. Client errors (4xx) are usually ignored unless they represent a misuse that could overload the downstream, such as 429 Too Many Requests, which we also treat as a failure for the breaker’s purpose."
5. Where do you store the breaker’s state in a distributed system?
I would respond: "For a single instance we keep the state in local memory, which is fast but not shared. In a multi-instance deployment we replicate the state in a shared store like Redis or DynamoDB, using a short TTL to keep it fresh. This ensures all callers see a consistent Open/Closed status without adding much latency—Redis round-trip is usually under 1 ms."
6. How do you prevent “thundering herd” when the breaker moves to Half-Open?
I would explain: "We use a token bucket or a fixed-size request pool. When the breaker is Half-Open we allow only a small number of test requests—commonly 1–5—to pass through. If they succeed, we transition back to Closed; if they fail, we revert to Open. This throttling stops a burst of retries from overwhelming the downstream."
7. What observability signals do you expose for a circuit breaker?
My answer: "I emit three primary metrics: the current state (Closed/Open/Half-Open), the failure-rate percentage, and the latency-guard breach count. These are pushed to a metrics system like Prometheus and visualized on a dashboard. Additionally, I log state transitions with timestamps so we can correlate spikes with deployment events."
8. How do you test a circuit breaker in staging before production?
I would say: "We simulate downstream failures with a mock server that returns configurable error rates and latencies. Automated integration tests run scenarios where the failure rate crosses the threshold, verifying that the breaker opens, that requests are short-circuited, and that the Half-Open retry logic works. We also run chaos-engine experiments (e.g., using Gremlin) to inject latency spikes and confirm the latency guard triggers."
9. How would you evolve the breaker design for a microservice that scales to millions of requests per second?
I would answer: "At that scale I would keep the counting local: each instance holds a small ring of per-second success and failure counters in memory, so recording an outcome is one atomic increment and no shared store sits on the request path. The state would be sharded by a hash of the downstream endpoint, reducing contention. I’d also add adaptive thresholds that adjust based on recent traffic patterns, and integrate the breaker with service mesh telemetry so the mesh can enforce the same policy without extra client code."
Senior vs. staff answers on circuit breakers
A senior answer explains the basic parameters—states, thresholds, and where the state lives—while also showing awareness of operational concerns like monitoring and testing. A staff answer goes further: it discusses distributed state strategies, adaptive algorithms, and integration with broader reliability tooling (service mesh, chaos engineering). It also anticipates future scaling challenges and proposes architectural changes rather than just configuration tweaks.
How to practice this
- Sketch a circuit-breaker diagram on a whiteboard or in a design canvas, labeling states, thresholds, and storage.
- Write out concise answers to each of the nine questions, focusing on concrete numbers and trade-offs.
- Use System Design AI’s practice board to draw the full flow and get AI feedback on your explanations.
Questions people ask
When should I use a circuit breaker instead of retries?
Use a breaker when the downstream service is consistently failing or slow, and you want to stop sending traffic altogether. Retries are for transient glitches; a breaker provides a hard stop after repeated failures.
Can a circuit breaker protect against downstream data corruption?
No. A breaker guards against unavailability and latency. Detecting corrupted data requires validation layers or checksums, which can be used alongside a breaker but serve a different purpose.
How long should the Open state timeout be?
A typical starting point is 30 seconds, then increase exponentially (e.g., 30 s, 1 min, 2 min) if the downstream continues to fail. The exact value should match the service’s recovery characteristics.
Should I expose circuit-breaker state to end users?
Usually you should not. Keep the state internal for monitoring and alerting. End users should receive a generic error or fallback response, not the internal resilience status.