Dashboard/System design/31. Design Uber

SYSTEM DESIGN · LESSON 31 OF 52 · 14 MIN VIDEO · 6 TOPICS

Design Uber

Module Progress (0 / 6 Lessons Completed)0%
System design Track (0 / 52 Modules) · Overall 0/80 (0%)0%
⌁

Narrated HD Video Lesson (14 min) · Pro

Lesson Overview + Section #01 + RESHADED Checklist + Quiz #1 are unlocked free below (no login required). Unlock all 80 HD video lessons and deep-dive sections — or watch our two free sample video lessons first.

SYSTEM DESIGN VIDEO LESSON & GUIDE

Design Uber

Designing Uber requires architecting a real-time, two-sided geospatial marketplace that matches riders with moving drivers in under 5 seconds, streams live trip telemetry, and settles fares with strict financial accuracy. At global scale—1,000,000 concurrent online drivers reporting GPS coordinates every 4 seconds (250,000 writes/sec) alongside 20,000,000 daily trips—the central architectural challenge is decoupling high-velocity, eventually consistent location telemetry from strongly consistent, durable trip and payment state machines. L4–L6 interviewers evaluate whether candidates avoid spatial-index lock contention on moving points, dispatch using road-graph ETA rather than Euclidean distance, and enforce end-to-end idempotency across external payment gateways.

WHAT YOU WILL MASTER IN THIS LESSON
  • Partition consistency and durability guarantees by domain: AP in-memory state for 250,000 writes/sec driver coordinates versus CP transactional persistence for trip state transitions and financial ledgers.
  • Eliminate spatial-index write contention on moving entities by decoupling O(1) in-memory driver hash map updates from periodic quadtree rebuilds or fixed hierarchical hexagonal grids (Uber H3).
  • Architect low-latency dispatch pipelines combining spatial candidate filtering with directed road-graph ETA evaluation over persistent WebSocket gateways.
  • Design event-driven fare settlement and sub-50 ms fraud scoring using pre-authorization holds, durable queues, trip_id idempotency keys, append-only double-entry ledgers, and hybrid rule + ML risk engines.
SYSTEMATIC INTERVIEW CHECKLIST · RESHADED + 45-MIN CLOCK

8-Step RESHADED Execution Checklist

Follow this exact sequence from the Intro narration on every system design prompt so you never miss requirements, math, contracts, or the 13-minute deep dive.

0 / 8 Checked
INTERVIEWER SCORECARD · WHAT MAKES A STRONG HIRE?

5 Signals Bar Raisers Grade (L4 vs. L5 Senior vs. L6 Staff)

Senior (L5 / E5 / Senior SDE) Bar — Autonomous Pacing, Depth & Proactive Trade-Offs: Owns the 45-minute clock without prompting, derives every component quantitatively, surfaces failure modes (hot shards, stampedes, dual writes) BEFORE being asked, and defends consistency vs. latency trade-offs.
1. Scoping
✓ STRONG HIRE SIGNAL

Clarifies users, read/write skew, p99 latency, consistency bounds, and explicit non-goals in minutes 2–8.

✗ NO-HIRE RED FLAG

Jumps straight into drawing load balancers and microservices at minute 2 without asking a single question.

2. Right-Sized Design
✓ STRONG HIRE SIGNAL

Starts with the simplest working architecture justified by the math (e.g., 1 NVMe SQL primary + replicas + Redis for 40 writes/s & 3 TB).

✗ NO-HIRE RED FLAG

Recites a memorized Kafka + multi-DC Cassandra diagram that contradicts their own traffic calculations.

3. Technical Depth
✓ STRONG HIRE SIGNAL

Drives deep into 1–2 hard bottlenecks (partition keys, hot-key mitigation, transactional outbox, KV-cache batching) at minute 27.

✗ NO-HIRE RED FLAG

Skims across 12 boxes at identical buzzword depth and runs out of time before the deep dive.

4. Explicit Trade-Offs
✓ STRONG HIRE SIGNAL

Uses 3-part reasoning: 'A queue here because SMTP spikes to 3 s; checkout stays <60 ms, and we accept eventual email delay + retry dedup.'

✗ NO-HIRE RED FLAG

Name-drops tools ('We put Kafka and ZooKeeper here') without stating the alternative or operational cost.

5. Communication
✓ STRONG HIRE SIGNAL

Thinks aloud every 30–45s, checks alignment at phase transitions, and treats 'What if X fails?' as a cue for where points are awarded.

✗ NO-HIRE RED FLAG

Goes silent for 5 minutes while drawing or defends a flawed assumption defensively when nudged.

ARCHITECTURE & DATA-FLOW SLIDES · SLIDE 1 OF 1Section 01: System Design: Uber
ARCHITECTURE / DATA FLOW DIAGRAM
waiting...Riderpay, check fraudUber serversmovingDriver 1movingDriver 2movingDriver 3
SECTION 01 OF 6

1. System Design: Uber

★ FREE PREVIEW
Key Takeaway: Uber combines a write-dominated geospatial index over continuously moving drivers with an ACID trip workflow and an exactly-once payment settlement pipeline.
ARCHITECTURE / DATA FLOW DIAGRAM
waiting...Riderpay, check fraudUber serversmovingDriver 1movingDriver 2movingDriver 3

Two-Sided Marketplace Mechanics

Uber coordinates riders and drivers across physical road networks in real time. Online drivers run a foreground client that transmits GPS coordinates to backend ingestion gateways every 4 s. When a rider opens the application, views nearby vehicles, and requests a ride from pickup to dropoff, the platform queries nearby available drivers, computes road-network arrival times, and dispatches an exclusive offer to the optimal candidate. Once the driver accepts, both clients track the vehicle's live trajectory until dropoff, triggering automated fare capture and bidirectional ratings.

  • Continuous Supply Telemetry: Every active driver emits (driver_id, lat, lng, timestamp) every 4 s, making write ingestion the highest-QPS path in the platform.
  • Time-Bounded Dispatch: Matching must complete within 3–5 s; riders forced to wait 30 s experience steep cancellation and churn rates.
  • Financial Atomicity: Every completed ride triggers real-world money movement across riders, drivers, and platform fees, tolerating zero lost or duplicate charges.

Why Moving Points Break Static Proximity Architectures

Candidates frequently attempt to reuse a static proximity architecture (such as Yelp or Google Places) where point-of-interest coordinates are indexed once in a read-optimized PostgreSQL PostGIS or R-tree cluster and cached heavily. That pattern collapses under ride-hailing workloads because 1,000,000 moving vehicles invalidate their coordinates every 4 s, turning read-optimized spatial trees into lock-contended write bottlenecks. Furthermore, static directory lookups are stateless reads, whereas a ride request initiates a stateful, multi-step workflow spanning exclusivity locks, driver timeouts, live streaming, and payment settlement.

Architectural DimensionStatic Proximity Service (Yelp)Dynamic Ride-Hailing (Uber)Engineering Consequence
Entity CoordinatesStationary venues; updated rarely (days/months)Moving vehicles; updated every 4 s per online driverCannot mutate disk-backed B-trees or R-trees synchronously on every ping
Read-to-Write RatioRead-dominated (100:1 reads to writes)Write-dominated (250,000 GPS writes/sec vs. 230 trip requests/sec)Ingestion path must use persistent sockets and lock-free O(1) in-memory overwrites
Distance MetricRadial Haversine distance (lat/lng bounding box)Directed road-network travel time (ETA) with live trafficSpatial index narrows candidates; road-graph ETA service makes final rank
State & ConsistencyStateless search queries; eventual consistency throughoutMulti-state trip lifecycle + real money settlementSplit architecture: AP memory tier for GPS, CP transactional DB + ledger for trips
Interview Signal: Interviewer Signal: Explicitly contrasting stationary spatial indexing (read-heavy disk trees) against high-frequency moving-point indexing (write-heavy in-memory state) in the opening 2 minutes immediately establishes Staff-level problem framing.
SECTION 02 OF 6

2. Requirements of Uber's Design

🔒 PRO SECTION
Key Takeaway: Enforce strict transactional durability and consistency for trip states and payments, while relaxing consistency to a 4-second staleness bound for 250,000 writes/sec of ephemeral driver coordinates.

Section 1 + Checkpoint Quiz #1 are unlocked free outside the paywall. Unlock all architecture slides, QPS & sharding trade-off tables, and all 80 narrated HD video lessons with Full Access — or inspect our sample payment system lesson first.

SECTION 03 OF 6

3. High-level Design of Uber

🔒 PRO SECTION
Key Takeaway: Persistent WebSocket gateways terminate 250,000/sec driver heartbeats into city-sharded in-memory location stores, while a transactional Trip Service coordinates candidate ranking across Spatial Index and road-graph ETA services.

Section 1 + Checkpoint Quiz #1 are unlocked free outside the paywall. Unlock all architecture slides, QPS & sharding trade-off tables, and all 80 narrated HD video lessons with Full Access — or inspect our sample payment system lesson first.

SECTION 04 OF 6

4. Detailed Design of Uber

🔒 PRO SECTION
Key Takeaway: Absorb 250,000/sec location writes in an O(1) hash map decoupled from spatial-index structure updates, push active trip telemetry via ephemeral pub/sub topics, and map each entity to a purpose-built storage engine.

Section 1 + Checkpoint Quiz #1 are unlocked free outside the paywall. Unlock all architecture slides, QPS & sharding trade-off tables, and all 80 narrated HD video lessons with Full Access — or inspect our sample payment system lesson first.

SECTION 05 OF 6

5. Payment Service and Fraud Detection in Uber Design

🔒 PRO SECTION
Key Takeaway: Decouple fare capture through durable event queues, guarantee exactly-once charging with trip_id idempotency keys and an append-only double-entry ledger, and block fraud via sub-50 ms inline risk scoring plus post-trip route audits.

Section 1 + Checkpoint Quiz #1 are unlocked free outside the paywall. Unlock all architecture slides, QPS & sharding trade-off tables, and all 80 narrated HD video lessons with Full Access — or inspect our sample payment system lesson first.

SECTION 06 OF 6

6. Evaluation of Uber's Design

🔒 PRO SECTION
Key Takeaway: In-memory location state self-heals within a single 4-second reporting cycle after crashes, while city-sharded stateless services, write-ahead SQL persistence, and idempotent payment queues guarantee zero lost trips or duplicate charges.

Section 1 + Checkpoint Quiz #1 are unlocked free outside the paywall. Unlock all architecture slides, QPS & sharding trade-off tables, and all 80 narrated HD video lessons with Full Access — or inspect our sample payment system lesson first.

ACTIVE RECALL & TRADE-OFF PROBES

System Design Checkpoint Quizzes (1)

CHECKPOINT QUIZ #1

In "System Design: Uber" (Why Moving Points Break Static Proximity Architectures), how does a production-grade design handle "Read-to-Write Ratio" (Engineering Consequence)?