Courier offer and reassignment

DesignHard50 minDoorDash and Uber style

Your task

Design the offer/acceptance and reassignment layer of a courier-dispatch system. After the matcher picks a courier for an order, the courier may decline or not respond, the restaurant may be slow, or the courier may go offline mid-route. You need to offer the order, time out non-responses, fall back to the next-best courier, and reassign in-flight orders when a courier drops, all while never delivering an order twice and never leaving an order stuck. ~5k orders/min per metro. Describe the offer state machine, timeout/escalation handling, reassignment correctness, and the trade-off between waiting for a preferred courier and falling back fast.

It covers

  • Multi stop
  • Courier rejection
  • Reassignment