Three states and one insight: after a sustained failure, retrying is worse than not calling at all, and the only way to learn whether the backend recovered is to send a small number of probes. The state machine, the two thresholds, and why a rate over a window beats a consecutive-failure count.
Implement a circuit breaker in front of a model endpoint. What are the states, and what does the half-open state buy?
Three states and one insight: after a sustained failure, retrying is worse than not calling at all, and the only way to learn whether the backend recovered is to send a small number of probes. The state machine, the two thresholds, and why a rate over a window beats a consecutive-failure count.
Updated Sep 2026 · Grounded in real AI infrastructure interview loops and written to a senior-engineer editorial bar, with every number worked and every diagram hand-built.
The concepts behind this question
Ranked by how closely each one overlaps this question's topic, so the first card is the thing to read if the answer above moved too fast.
Scored on the three states with the half-open probe, on a failure rate over a window rather than consecutive failures, and on knowing this complements retry rather than replacing it.
No comments yet — be the first to share your approach.
