Design a Restaurant Management System
HardReal World SystemsObserverFactoryStateStrategy
Problem Statement
Design a restaurant management system that handles:
- Table management (reservation, seating, clearing)
- Menu management (items, categories, prices, availability)
- Order management (placing, modifying, tracking status)
- Kitchen workflow (order queue, item preparation)
- Billing (generate bill, apply discounts, split bill)
- Staff management (waiters, kitchen staff, manager)
Design Requirements
Key Entities:
Restaurant— Main system (Singleton)Table— Physical table with statusMenuItem— Food/drink item with price and categoryOrder— A table's order with multiple OrderItemsOrderItem— A specific menu item with quantityBill— Final bill with tax, discountsKitchenDisplay— Shows pending orders to kitchen (Observer)Waiter,Chef— Staff with roles
Order Flow: SEATED → ORDER_PLACED → PREPARING → READY → SERVED → BILLED → CLEARED
Key Behaviors:
seatCustomers(tableId, partySize)→ assigns tableplaceOrder(tableId, items)→ creates Order, notifies kitchenmarkItemReady(orderId, itemId)→ kitchen marks item donegenerateBill(tableId)→ calculates total with tax
!Constraints
- Restaurant has 5–50 tables of varying capacity (2, 4, 6, 8 seats)
- Menu has up to 100 items across 5 categories
- Multiple orders can be placed for the same table (e.g., refills, add-ons)
- Tax is 10%, optional service charge is 18%
- Support bill splitting by seat or equally
- Order status updates notify kitchen display (Observer)
Output
Run your code to see output here.