Design GPS Trace Storage and Map Matching for Completed Trips
Last updated: November 29, 2026
Quick Overview
Design how Uber stores the raw GPS pings from every trip and turns them into a road-snapped route used for fare distance, receipts, disputes, and map quality improvements.
Uber
November 29, 20260
0
0 solved
Design how Uber stores the raw GPS pings from every trip and turns them into a road-snapped route used for fare distance, receipts, disputes, and map quality improvements.
Distance-based fares and safety investigations depend on knowing exactly which roads a trip used, so Uber interviewers probe how noisy GPS becomes a trusted route. They check storage layout for write-heavy time series, the map matching approach, and how results stay reproducible for disputes.
What the Interviewer Expects
- Separate hot ingestion from cold, compressed long-term storage
- Explain map matching as finding the likely road sequence (HMM or similar)
- Handle GPS noise, tunnels, and missing segments
- Version the road graph so a historical match can be reproduced
- Serve both per-trip lookups and bulk analytics
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How do you compute fare distance when the phone lost GPS for two minutes in a tunnel?
- How would you detect that a map road is missing using many traces?
- How do you compress a trace and how much do you save?
- Should matching run in real time during the trip or after it ends?
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
Driver app sends a ping every 1 to 4 s (lat, lng, accuracy, speed, bearing, timestamp). Per trip: store raw points, produce a matched polyline and distance within a minute of drop-off, keep for years ...
High-Level Design
- Ingest: pings flow through the location gateway into Kafka keyed by trip id.
- Hot store: a wide-column table keyed by
(trip_id, ts)for active and recent trips. - Trip close job: on `...