Length 1:35Loading the video
Loading the video
How to design a ride app like Uber, where a million drivers send their location every few seconds. Keep live locations in memory, split the map into cells to find nearby drivers, and push trip offers over open connections.
Narrated by an AI voice.
How would you build a ride app like Uber that handles millions of requests per minute?
Most of that traffic comes from drivers sending their location.
Say one million drivers are online.
Each phone sends its position every four seconds.
That is two hundred fifty thousand writes per second, or fifteen million per minute.
First, every request reaches a load balancer.
It spreads the traffic over many copies of an API gateway.
The gateway sends each request to a small service with one job.
The location service keeps only the latest position of each driver.
It holds that in memory, in a fast store like Redis.
Matching does not need old positions, so we skip the disk.
A copy goes to an event log like Kafka, for maps and billing later.
Now a rider asks for a car.
Checking every driver in the world would be far too slow.
So we split the map into cells.
Uber uses hexagon cells from its open source library, H3.
To find nearby drivers, we look only at the rider's cell and its neighbors.
The matching service ranks those drivers by arrival time.
It offers the trip to the best one.
The offer goes out over an open WebSocket connection, so the phone gets it right away.
When the driver accepts, the trip service saves the trip in a database.
To grow, we split the system by region.
Drivers in one city rarely matter to another city, so each region gets its own servers.
More traffic means more copies of each service behind the load balancer.
So the design rests on three ideas.
Keep live locations in memory.
Search by map cells.
Push offers over open connections.
The system design interview: a repeatable approach
How system design interviews are run, and a five-step approach to repeat: requirements, rough numbers, API, data and scaling, with two worked examples.
Type any algorithm, interview problem or system, and get your own narrated video.
3 free videos with your own AI key. An AI key is a code from an AI company, such as Anthropic or OpenAI. Your own AI account pays for the writing. See pricing
Make a video
Length 1:35
Length 1:13
Length 2:20