Design Uber
Overview– Uber is a ride-sharing platform that connects passengers with drivers who offer transportation services in personal vehicles. It allows users to book rides on demand from their smartphones, matching them with a nearby driver who will take them from their location to their desired destination. Functional Requirements– Users should be able to input a start location and a destination and get an estimated fare. Users should be able to request a ride based on an estimate. Drivers should be accept/deny a request and navigate to pickup/drop-off Out of scope— Multiple car types Rating for drivers and riders Schedule a ride in advance Non-Functional Requirements– Low latency matching < 1 min match or failure Consistency of math. Ride to driver is 1:1 Highly available outside the matching. Handle high throughput and surges for peak hours or special events. 100s of thousands of requests within a given region. Out of scope— Resilience and handling system failures Monitoring logging, alerting, etc. CI/CD pipeline Core Entities— Ride Driver Rider Location API– POST /ride/fare-estimate -> Partial<Ride> { Source, destination } PATCH /ride/request -> 200 { rideId } POST /location/update { lat, long } PATCH /ride/driver/accept { rideId, true/false } PATCH /ride/driver/update -> lat/long | null { rideId, status: “pickup | droppedoff” } High Level Design --