DoorDash 00:00:01 Dinner is accepted before a courier is chosen A family orders dinner from a busy kitchen. In this illustrative delivery marketplace, placing the order, reserving funds and assigning a courier are separate commitments. One fast success response cannot mean all three are finished. Restaurant, items with options, address, payment token, quote and a key made by the app. Open, in stock, price of the quote. All there, and about 21 minutes of cooking. The example authorizes thirty-eight dollars and seventy-eight cents. Authorization reserves funds without necessarily capturing the payment. 201 with a range of 37 to 46 minutes. Persist the order identity and quote. Report acceptance with an estimated range, then let dispatch operate asynchronously. If the kitchen later refuses, the design needs an explicit state change and a corresponding payment action. 00:01:00 Give dispatch a short decision window Once the food is close to ready, several kitchens need riders at the same time. Looking at one kitchen first can force bad choices for all the others. This dispatcher considers a bounded group of orders and nearby eligible couriers. In the biggest market 87 become due in ten seconds. For each kitchen, couriers within 5 miles, nearest first, at most 20. Two miles in traffic can be slower than three on free roads. The ETA service returns ranges. Optimize the total assignment cost when practical. A time-bounded fallback can produce a usable answer if the solver cannot finish before dispatch is due. The update matches order, courier, OFFERED and time, so one row changes. Courier 2 leaves the free list. A route estimate matters more than straight-line distance. Assign only if the offer still identifies the expected courier, order and valid deadline. A late acceptance must not take a delivery already assigned elsewhere. 00:02:04 The faster first choice costs six extra minutes There are two riders and two kitchens. Start with the shortest individual trip, two minutes, and remove its courier and kitchen. Predict the total time before reading the last remaining cell. Each cell is a courier's time to an order's kitchen. Courier A takes order 1: the smallest number. Courier B must take order 2: 10 minutes. Together 12. Courier A takes order 2 (3), courier B takes order 1 (3). Three plus three gives six total minutes. The improvement comes from considering the second rider's remaining alternatives. The greedy assignment costs twelve minutes. Matching the two three-minute trips costs six. The best local pair and the best total pairing differ even in this four-cell example. 00:02:54 Cooking and travel can overlap The kitchen estimates twenty-one minutes at the middle of its range. The courier arrives around minute twenty. Adding both as if they were sequential predicts a delay the customer will never experience. The model returns 18, 21 and 25 minutes (quarter, middle, three quarters). Dishes, queue, hour. Dispatch at minute fourteen plus six minutes of travel gives minute twenty. The courier can travel while dinner cooks. Park, walk in, check the bag: 3 minutes. The map says 12. Our own past trips on this route and hour say 14. Many draws of all parts give 37 to 46. A breakdown is kept, so support can see what was late. Take the later of readiness and arrival before adding pickup, travel and door time. For an uncertainty range, combine the underlying timing scenarios rather than mechanically adding independent percentile endpoints. 00:03:57 A double tap is still one dinner The order was saved and the authorization succeeded, but the phone lost the response. The customer taps again. Decide which identifier recognizes the same purchase across both attempts. The order is stored, the money held. The answer is lost on the way. Same key k1. The unique rule on customer and key finds the first order. The order's present state is returned. Nothing is charged again. The stored customer-and-key relationship returns the existing order. Check that a reused key describes the same intended payload. Delivery reliability includes the human result: one dinner, one authorization and a traceable current status.