All jobs / Backend developer / Distributed Systems
Backend developer interview question · 3–5 years
The interviewer asks: “A dependency is failing. How do you stop your service from dying with it?” Strongest answer?
The strongest answer
A circuit breaker (or concurrency limiter) plus a timeout: fail fast, shed or degrade, and probe half-open. I don't queue unbounded work behind a dead dependency.
Why it works
Exactly. Breakers protect your pool and give the dependency room to recover. Combine with a fallback the product agreed to.
What a good answer covers
- Timeout + breaker + fallback.
- Fail fast; don't queue forever.
- Don't retry storms.
- Don't paint 200 over an outage.
Answers that fall short
- Close, but not the strongest: Retry harder so users don't notice.
Harder retries are the opposite of a breaker — you become the DDoS. - Weak: Catch all errors and return empty 200s so our error rate stays green.
Fake 200s hide the outage from you and lie to the user. Degrade visibly or fail honestly. - Red flag: Restart our pods whenever the dependency fails.
Restarting healthy callers doesn't fix the dependency and can make cold-start thundering herds.
Who gets asked this
More Distributed Systems questions
- The interviewer asks: “The outbox publisher crashed after sending but before marking sent. What happens?”…
- The interviewer asks: “Recommendations are down. Checkout still needs to work. What do you do?” Strongest…
- The interviewer asks: “We're adding a search index. Can the API write DB and Elasticsearch in one request?”…
- What happened, and what actually protects the write?
- The interviewer asks: “Active-active in two regions — what's the hard part?” Strongest answer?
- The interviewer asks: “A client retries POST /payments because of a timeout. How do you not charge twice?”…
- The interviewer asks: “A downstream HTTP call timed out. Do you retry?” Strongest answer?
- The interviewer asks: “Your HTTP client has no timeout. What's the risk?” Strongest answer?