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
Software Engineering Fundamentals
Software Engineer
DoorDash
November 29, 2026
Software Engineer
Phone Screen
Software Engineering Fundamentals
Easy

0

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
networking basics
timeouts
retries and backoff
jitter
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. 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 Problems
Sample Answer
Requirements
  • send(timeout) performs one request and raises RetryableError for retryable failures.
  • At most attempts tries, each with min(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 ...


Submit Your Answer
Markdown supported