Implement Exponential Backoff With Full Jitter and a Retry Budget
Last updated: November 29, 2026
Quick Overview
Write the retry helper the rider app's networking layer uses for idempotent calls: exponential backoff with full jitter, a cap, respect for server Retry-After hints, and a retry budget that stops retry storms during an outage.
Uber
November 29, 20260
0
0 solved
Write the retry helper the rider app's networking layer uses for idempotent calls: exponential backoff with full jitter, a cap, respect for server Retry-After hints, and a retry budget that stops retry storms during an outage.
When an Uber backend has a blip, millions of phones retrying in lockstep can turn a short outage into a long one. Interviewers check that you know why jitter matters, which errors are safe to retry, and how a retry budget limits amplification.
What the Interviewer Expects
- Retry only retryable failures and only for idempotent operations
- Grow delay exponentially with a cap
- Randomize with full jitter to spread out synchronized clients
- Honor Retry-After from 429 or 503 responses
- Bound total retries with a budget tied to normal traffic
- Make sleep and randomness injectable for tests
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- Why is full jitter better than adding a small random offset to fixed backoff?
- Which HTTP errors should not be retried?
- How should retries work in a chain of three services calling each other?
- How would you set the budget ratio?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
call_with_retries(fn) runs fn, retries on RetryableError (timeouts, resets, 503, 429) up to max_attempts, sleeps between attempts, and re-raises the last error. A shared RetryBudget across c...
High-Level Design
Delay for attempt is drawn uniformly from (full jitter). If every client waited exactly , clients that failed together would retry together, hittin...