Design a Workplace Lunch Ordering Platform
Design a workplace meal-ordering service with rotating daily restaurants, customizable menus, live availability updates, and consistent order submission.
Problem statement
Design a workplace lunch-ordering application. Employees log in, see the restaurants available for the current day, browse each menu, customize items using the options that restaurant offers, and submit an order.
Restaurant and menu data can change in real time; the design must handle technical failures or an item becoming unavailable during submission, choose suitable menu storage, and use caching without serving unsafe checkout decisions.
For this exercise, assume restaurant partners publish versioned daily menus for one workplace region, accepted orders bind to the exact menu and option versions that were validated, and payment, delivery routing, refunds, and restaurant kitchen operations are outside scope.
For this exercise, assume every order attempt carries a stable client idempotency key; retries with the same key must converge on exactly one durable order and return its same accepted, rejected, or pending outcome, including after a timeout or lost response.
For this exercise, assume 100,000 daily employees, peaks of 2,000 menu reads and 200 order attempts per second, 30-second p95 propagation for partner menu changes, 300-millisecond p95 menu reads, and one-second p95 accepted-order commands.
What to build
- Employees can authenticate and view the restaurants currently available for their workplace and service day.
- Employees can browse each available restaurant menu and the exact customization options currently offered for each item.
- Employees can submit a customized order idempotently and receive one authoritative accepted, rejected, or pending outcome.
- Restaurant and menu changes propagate to browsing quickly while checkout rejects stale or unavailable selections safely.
At scale
- For this exercise, assume 100,000 daily employees in one workplace region.
- For this exercise, support peaks of 2,000 restaurant or menu reads and 200 order attempts per second.
- For this exercise, target 300 milliseconds p95 for restaurant and menu reads and one second p95 for an accepted order command.
- For this exercise, propagate partner menu changes within 30 seconds p95; checkout always validates the authoritative current menu version before accepting an order.