KatInterview

Choosing Safe Meeting Spots for a Ride-Hailing Trip

System DesignModel answer
MediumModel answerSystem Designsystem-designmapsrouting

Last updated

Design a service that picks a legal, safe, and convenient meeting spot for a rider and driver, balancing walking time, driver arrival time, and confidence.

Design the algorithm and the high-level system that suggests a meeting spot for a rider and a driver in a ride-hailing app.

A rider requests a trip from an approximate location, for example inside a large building or near a busy intersection. A driver is available at a known GPS position. The system must propose a spot that the rider can walk to and the driver can legally and safely reach.

Assumptions

  • You can use map data, road and pedestrian graphs, routing and ETA services, and live traffic when available.
  • The rider's GPS reading can be noisy, or can fall inside a building.
  • The driver must be able to stop legally and safely at the chosen spot.
  • The chosen spot should balance rider walking time, driver arrival time, safety, reliability, and overall user experience.
  • The result must be shown clearly in both the rider app and the driver app.

Questions you may want to raise with the interviewer

  • Which environments are in scope: dense downtown, suburbs, airports, campuses, or all of them?
  • Is rider mobility or accessibility information available?
  • What is the maximum acceptable walk?
  • Do we have data on legal stopping zones, curb access, building entrances, and past pickup outcomes?
  • What are we optimizing: total trip time, cancellations, unsafe stops, or support contacts?

What to cover in your answer

  1. Position cleanup and map matching for rider and driver.
  2. Candidate generation.
  3. Safety and legality filtering.
  4. Scoring and selection.
  5. Architecture and data flow.
  6. How the result is presented, including low-confidence fallbacks.
  7. Learning from history and measuring success in an experiment.

Hints

Hint 1

Treat the problem as a pipeline: clean up locations, generate candidates, filter hard constraints, then rank the survivors with a weighted or learned score.

Hint 2

Keep hard constraints (legal stop, safe side of the road, no highway ramps) separate from soft trade-offs (walk time vs. driver detour). Never let a good score override a safety rule.

Hint 3

Plan for uncertainty: when the rider's location is poorly known, show a confirmation step or let the rider adjust the spot, and use past pickups to refine candidates over time.