Let us design a ride hailing App like Uber from scratch. We will only design the core flow of servicing a ride. This include both the rider and driver’s experience – the user request a ride; our service find a driver; the driver serves it. We will focus on the hard and meaty design problems specific to a ride hailing App. For readers unfamiliar with the building blocks and basic concepts, we will provide reference to their corresponding materials.
Below is the high level overview of the life of a ride.
The rider send the ride request information to our backend service. The request consists of
The backend service find a driver to serve the ride and send the ride information to the driver.
2.1 The service first find a list of nearby drivers available
2.2 Then send the ride information to all available drivers
2.3 Pick the first confirmed driver
2.4 Send the ride information to the driver
The rider and driver both goes to the pick up location. In the meantime, the rider receives realtime update of the driver’s location.
Problem decomposition is a key aspect of system design. It involves breaking down a complex problem into smaller, more manageable subproblems. One way to break down is by listing the operation flow and identifying the complex or ambiguous steps, each such steps is a subproblem. Let’s review the functional requirements in the last section, the flow can be specified as below.
The obvious complex steps are #3, #5, and #7. Therefore, we turn the into three subproblems.
[S1] Locating nearby drivers: Efficiently finding available drivers near the rider's pickup location.