Design a Rapid Grocery Ordering Platform
Serve location-aware grocery inventory and turn one cart into one paid, fulfilled, and trackable order without overselling.
Problem statement
For this exercise, assume one grocery retailer operates many local fulfillment locations. A customer chooses an address, browses currently sellable SKUs, builds a cart, obtains a ten-minute inventory reservation, authorizes payment, and receives one confirmed order for picking and courier dispatch.
Catalog reads may be slightly stale, but checkout revalidates location, price, and inventory. Assume 1 million daily active users, 100,000 SKUs across 500 locations, 50,000 browse requests per second, and bursts of 5,000 checkouts per second.
Return browse pages within 300 ms at p99 and finish 99 percent of uncontended reservations within two seconds. Preserve this invariant: one inventory unit may back at most one active reservation or confirmed order, and an expired reservation cannot confirm.
Keep marketplace sellers, loyalty programs, and cross-border delivery outside the first version.
What to build
- Resolve a fulfillment location and browse its sellable catalog with explicit freshness.
- Create one expiring, retry-safe reservation for the cart's inventory quantities.
- Authorize payment and commit one order without double charging or overselling.
- Drive picking, substitution outcomes, dispatch, and customer-visible tracking.
At scale
- For this exercise, assume 1 million daily active users, 100,000 SKUs across 500 locations, 50,000 browse requests per second, and bursts of 5,000 checkouts per second.
- For this exercise, return browse pages within 300 ms at p99 and finish 99 percent of uncontended reservations within two seconds.
- For this exercise, reservations expire after ten minutes, and inventory, payment, and order discrepancies must be detectable and repairable without silently confirming an oversold order.