RETURN TO SYSTEM DESIGN VAULT (55)BLUEPRINT #27 // Very Hard
#27Very HardLocation, Geospatial & Ride-Hailing
Design an ETA Service and Location Sharing Between Driver and Rider
ASKED IN INTERVIEWS AT:UberFAANG
EXECUTIVE SUMMARY & PROBLEM STATEMENT
Design a real-time driver tracking and ETA calculation engine streaming GPS coordinates to riders with map matching and route graph traversal.
SCALE ESTIMATION & TRAFFIC ENVELOPE
DAILY ACTIVE USERS / TPS5 Million active concurrent trips globally
READ / WRITE TRAFFIC RATIOHeavy bidirectional streaming
5-YEAR STORAGE CAPACITYTransient in-flight stream processing
FUNCTIONAL REQUIREMENTS
- [1]Stream driver GPS coordinates to rider every 4 seconds
- [2]Calculate and continuously update accurate ETA based on live traffic
- [3]Snap noisy GPS coordinates to road network
NON-FUNCTIONAL REQUIREMENTS
- •Live coordinate delivery latency < 1 second
- •Battery-friendly transmission protocols (Protobuf over WebSockets)
- •Highly available
CORE ARCHITECTURAL COMPONENTS
WebSocket Push Gateway
GPS Map-Matching Engine
Live Traffic Routing Graph Engine
ETA Calculator Service
Redis Pub/Sub Pipe
DATA SCHEMA & PERSISTENCE
TripSession: trip_id, driver_id, rider_id, origin, destination, current_eta_secs
DISTRIBUTED TRADE-OFFS & FAILURE MODES
- ⟡Contraction Hierarchies pre-process road networks for 1ms routing queries instead of expensive real-time Dijkstra.