P

PrepStack

"Case Study: Ride Sharing"

A ride-sharing service shows nearby drivers to a rider and gives each ride request to one driver. This note builds one reasonable design from stated assumptions. The central trade-off is speed against exactness: a grid index (a lookup structure that finds drivers by place) checks a few cells, not every driver, and an atomic claim (one step that cannot be split) makes sure a driver gets only one ride. The numbers are examples worked out with a short program. After this note you can explain the grid search, when it gives the right answer, and how a match stays safe when drivers decline or go offline.

Topics in this section