Timeouts, retries and exponential backoff: how not to take the server down?
The gist
Retries cure transient failures, but a naive retry — immediately, unbounded, for any error — turns a partial server outage into a full one: millions of clients in lockstep finish off an overloaded backend (a retry storm). A correct retry fires only on transient errors, only for requests that are safe to repeat, with exponential delay and jitter, an attempt limit and respect for cancellation.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep