All posts
System Design Mastermind · Part 01
  • System design
  • Distributed systems
  • Interview prep

Uber system design, reverse-engineered: from tap to pickup

How Uber turns a ride request into an assigned driver, walked through in real interview order: numbers, API, high-level design, one request end to end, databases, geo search, cancellations, and what happens when each service fails.

22 Oct 2026 · 30 min read · interactive

Share

The 1-minute answer

Driver apps stream location every few seconds into an in-memory geo index sharded by map cell. When a rider taps Request, the ride service records the ride, answers 202 processing and asks dispatch for a driver. Dispatch reads the pickup cell and its neighbours for candidates, then ranks them by road ETA, not straight-line distance. The best driver gets an offer over a push stream with a 15-second timeout; accept is a compare-and-set, so only one driver can win. Every call is safe to retry, and the system prefers availability over strict consistency everywhere except ride state and money.

How this page follows the interview

Each phase is a section below, in the order you'd present it. Click a phase for what to say, what to write, and the trap.

✅ Seen: Uber said so (cited)🔶 Inferred❓ Unknown: state it as an assumption🧭 Interview choice, not an Uber claim

Requirements and numbers

Agree scope, then size it. Change any input: each number below comes with the decision it forces, and the same decisions reappear in the design and database sections.

Functional

  • Rider sees a fare and nearby cars
  • Rider requests; one driver is matched within seconds
  • Driver accepts or declines; both see live tracking
  • Either side cancels; trip completes; rider pays

Non-functional

  • Tap to offer on the driver's phone: under 1 s (p95)
  • Matching stays up; locations may be a few seconds stale
  • Ride state and payments: correct, never duplicated
  • Survive a service, or a whole data centre, failing mid-trip

Out of scope (say it)

Onboarding, ratings, support tooling, building maps.

Capacity calculator

4 s pings ✅ and the ~1M writes/s target ✅ are from Uber's 2015 talk. The rest are assumptions 🔶: say them out loud.

Three rules for any estimate
  1. Per second = per day ÷ 86,400 (seconds in a day). Round it to ~100,000 in your head.
  2. Peak = average × a peak factor (2–3× for rush hour). Design for the peak.
  3. Separate writes from reads, and ask of each number: does it change a decision? If not, skip it.
They'll push on thisAnswer out loud, then open.

Core entities and the API

Name the entities first, then the few calls that move them. Keep it short in the interview; what they listen for is who owns the price, and why a retry is safe.

EntityKey fieldsNote
Request
Response

How the fare is calculated

The estimate call runs this on the server and stores the result behind fare_id. Rates are set per city and product; the ones below are made up for the example. Change the trip and watch each line.

Where each number comes from

  • Distance and duration: the routing engine's estimate of the route, before the trip starts. 🔶
  • Rates: base, per km, per minute, booking fee and minimum fare, configured per city and product. 🔶 reported 2016
  • Surge: demand ÷ supply in the pickup's H3 cell, smoothed over neighbouring cells and the last few minutes so it doesn't jump. ✅ H3 2018
  • Upfront price: the rider sees the final number before booking, and it's locked in the quote behind fare_id for 2 minutes. ✅ Riders API

Surge multiplies the time-and-distance part; the booking fee and tolls are added after. Exact rules vary by city.

They'll push on thisAnswer out loud, then open.

High-level design

Build it in passes and say why each box exists. Click any box to see what it does, what it owns, what's inside it and what you'd watch.

They'll push on thisAnswer out loud, then open.

Walk one request, box by box

From driver pings to the rider being charged. Each step lights up the path, and shows what goes over the wire, where it's stored and how long it takes.

On the wire

Arrows show who calls whom, and the numbers give the order. Replies go back along the same line.

Who sends a push, and how it reaches the phone

Services never talk to phones directly. They publish what changed, and the push platform decides, builds and delivers. Uber splits this into three parts.

    The same ride from both phones

    The two apps never talk to each other. Commands go up over HTTPS; updates come down one push stream per app.

    Data and database choices

    "Which database, and why?" is guaranteed. Start from the access pattern and your numbers, then name the store and what you gave up.

    DataPickConsideredWhy not those

    Database decision helper

    Answer four questions about any piece of data. Say them out loud: the questions are the reasoning.

    Atomic accept: the one query to know

    -- Only one driver can win; retries are harmless.
    UPDATE rides
       SET status = 'accepted',
           driver_id = :driver_id,
           version = version + 1
     WHERE ride_id = :ride_id
       AND status = 'offered'
       AND offered_driver_id = :driver_id
       AND version = :expected_version;
    -- 1 row updated  → accepted
    -- 0 rows updated → offer expired or taken: 409

    Compare-and-set with a version column. In a key-value store, the same idea is a conditional put.

    More database questions

    They'll push on thisAnswer out loud, then open.

    Ride lifecycle and cancellations

    Statuses use the names from Uber's public API. Click events to move the ride; invalid ones are disabled, because the server enforces them with compare-and-set. Each event shows what fires across the system.

    Happy pathSomething went wrongGreyed out: not allowed from the current status.

    Edge cases interviewers love

    They'll push on thisAnswer out loud, then open.

    Failure, monitoring and recovery

    "What if this goes down?" follows every diagram. Click a box to take it down: red is the failed service, amber is its blast radius. Each answer covers impact, degraded mode, the alert that fires, automatic and manual recovery, and how you'd trace it.

    Tracing it back: one request, healthy vs ETA timing out

    Every span carries the request id and ride id. In the bad trace, the ETA call hits its 50 ms deadline and dispatch falls back to distance ranking: slower and slightly worse, but the ride still matches.

    How one failure becomes three

    What you'd alert on (SLOs)

    SignalTargetAlert

    Incident playbook

      The resilience toolkit

      Name the pattern, then say where it goes in this design.

      They'll push on thisAnswer out loud, then open.

      Making it fast, and who owns what

      Machine time is milliseconds; human time dominates. Make the machine path fast so the driver sees the offer instantly, then work on acceptance. Bars are sizing estimates, not Uber figures.

      TeamOwnsPaged when…

      Senior follow-ups beyond the happy path

      Interviewers pick from these themes once the design is on the board. Have one concrete answer per theme, tied to this design.

      Practice ladder

      Real interviews go level by level. Answer out loud before opening each one. Levels 6–7 are where Senior becomes Staff.

      Sources

      Sources date from 2015 to 2022; Uber's current internals may differ. In an interview, say so.

      System Design Mastermind · Classics

      Series home

      All of Classics

      6 published · 4 comingThe problems almost every loop draws from.

      01

      Uber system design, reverse-engineered: from tap to pickup

      In-memory geo index sharded by map cell → rank nearby drivers by road ETA → offer to one driver with a 15 s timeout → accept with compare-and-set → push updates to both apps.

      You're reading this Preview
      12

      Rate limiter system design: fair limits at a million requests a second

      Check every request once in the API gateway → one atomic Lua script per request on the caller's shard of a sharded Redis (token bucket for per-second, window for per-day) → 429 + Retry-After, or forward with RateLimit headers → local cache for keys already over → each rule fails open or closed on purpose.

      30 min · interactive Preview
      23

      WhatsApp system design: chat, offline delivery and the three ticks

      One long-lived encrypted connection per device → the chat server stores a copy per recipient device in a replicated offline queue, then acks (✓) → session lookup, forward or push → the device saves and acks, the copy is deleted (✓✓) → a read receipt when opened. Client-made ids and dedupe at both ends, backoff with jitter on reconnect, Sender Keys for groups.

      32 min · interactive Preview
      26

      Ticketmaster system design: selling seats without double-booking

      Cached reads for browsing → a seat inventory with one row per seat, sharded by event → a hold is one conditional UPDATE (only if free or expired) with a 10-minute timer → pay with a client-made idempotency key → confirm only if the hold is still yours, plus an outbox for tickets. A waiting room admits fans at the rate booking can serve.

      32 min · interactive Preview
      29

      News feed system design: fan-out, celebrities and ranking

      Write each post once → fan-out workers push its id into active followers' capped Redis timelines → accounts above ~1M followers are merged at read time instead → the feed service gathers ~1,500 candidates, a light model trims them, a heavy model predicts actions, a weighted sum orders them → deletes and blocks are checked at read time, pages use a cursor.

      32 min · interactive Preview
      32

      Notification system design: push, email and SMS without spam, drops or duplicates

      One Notify API with an idempotency key → a router checks dedupe, preferences, caps and quiet hours, picks live devices → per-channel queues with a transactional lane apart from bulk → workers call APNs, FCM, email and SMS with priority, expiry and a collapse id, retry 429s with backoff and delete dead tokens → campaigns paced below the provider quota, OTPs fall back to SMS.

      32 min · interactive Preview
      ··

      Video streaming (YouTube / Netflix)

      Coming next
      ··

      URL shortener

      Coming next

      More posts