Try
↑ ↓ move↵ openesc close

Interview prep / Retries and circuit breakers

Junior · Retries and circuit breakers · System design interview question

What is exponential backoff, and why is jitter added to it?

Sketch your own answer first, then compare it with the one below.

A strong answer

Exponential backoff means waiting longer after each failed attempt, usually doubling the wait up to a cap. A client that is failing sends fewer and fewer requests, which gives a struggling dependency room to recover.

On its own it has a weakness. If many clients fail at the same moment, because a server restarted or a connection dropped, they all wait the same time and retry together. The retries arrive in waves, and each wave can be as big as the first.

Jitter adds randomness. With full jitter each wait is a random time between zero and the backoff ceiling, so the clients spread their retries over the whole window. The peak load falls, and the dependency sees a smoother stream.

Jitter spreads the same number of retries over time. It does not reduce the total. To cap the total you need a retry limit, a budget or a circuit breaker.

Sources

Learn it by running it

The retries, timeouts and circuit breakers lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms