Retry Cloud Control-Plane Calls With Jittered Exponential Backoff
Last updated: November 29, 2026
Quick Overview
Write a helper that calls a function and retries only on retryable errors using exponential backoff with full jitter, a cap per sleep, a maximum attempt count, an overall deadline, and respect for a server-provided retry-after hint.
Coreweave
November 29, 20260
0
0 solved
Write a helper that calls a function and retries only on retryable errors using exponential backoff with full jitter, a cap per sleep, a maximum attempt count, an overall deadline, and respect for a server-provided retry-after hint.
Common in infrastructure loops at a GPU cloud, where operators and controllers hit Kubernetes APIs, BMC interfaces and provisioning services that throttle under load. The interviewer checks that you know why jitter matters for thundering herds and that the code is testable without real sleeping.
What the Interviewer Expects
- Retries only classified retryable errors (429, 503, resets), never 4xx validation errors
- Uses full jitter and a cap
- Honors an overall deadline, not only attempt count
- Injects sleep, clock and randomness for tests
- Re-raises the last error with context
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
- How does this interact with a client-side rate limiter or circuit breaker?
- Is it safe to retry a create-node call? How would idempotency keys help?
- What changes if thousands of controllers restart at the same moment?
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_backoff(fn, ...) returns fn() on success. On RetryableError it sleeps and retries, up to max_attempts total. Delay for attempt i is random(0, min(cap, base * 2^i)). If the error ca...
High-Level Design
Exponential growth backs off quickly when a dependency is unhealthy; full jitter spreads clients uniformly so a fleet of controllers does not retry in lockstep and re-overload the API server. Injectin...