Add Timeouts and Jittered Retries to the Dasher Location Client
Last updated: November 29, 2026
Quick Overview
The Dasher app sends location pings over cellular networks that drop and stall. Write a client helper that applies a per-try timeout, an overall time budget, capped exponential backoff with jitter, and retries only on retryable failures.
DoorDash
November 29, 20260
0
0 solved
The Dasher app sends location pings over cellular networks that drop and stall. Write a client helper that applies a per-try timeout, an overall time budget, capped exponential backoff with jitter, and retries only on retryable failures.
A networking fundamentals question in the style of DoorDash screens. The interviewer wants to hear what happens on a bad connection (DNS, TCP, TLS, request, timeouts), which errors are safe to retry, and why jitter prevents thousands of Dasher phones from retrying in lockstep after an outage.
What the Interviewer Expects
- Distinguish connect and read timeouts from an overall deadline
- Retry only idempotent requests and retryable errors (timeouts, resets, 429, 503)
- Use capped exponential backoff with full jitter
- Never let retries exceed the total budget
- Make sleep, clock 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
- How do TCP keep-alive and connection reuse affect latency on mobile?
- How would you respect a Retry-After header?
- When would you batch location pings instead of retrying each one?
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
send(timeout)performs one request and raisesRetryableErrorfor retryable failures.- At most
attemptstries, each withmin(per_try_timeout, remaining budget). - Delay before retry n: rando...
High-Level Design
On a phone, one request involves DNS lookup, a TCP handshake, a TLS handshake and then the HTTP exchange, and any of these can stall on a weak signal. A per-try timeout stops one stalled attempt from ...