The "Restaurant / OOD" Amazon interview question focuses on designing an object-oriented system for restaurant management, typically tagged for backend development, OOD principles, and sometimes extended to web/system design or ML elements like recommendations.[1][5][7]
Problem Statement
Design an object-oriented system for a dine-in restaurant that handles table reservations, seating, ordering, and order fulfillment. Key entities include tables with varying capacities, parties (groups of customers), orders with items from a menu, and states for orders (e.g., PLACED, IN_PREP, READY, SERVED, CANCELLED). Support login for users/staff, party seating at suitable tables, and basic operations like creating orders with multiple menu items.[5][7]
Core Requirements
Restaurant has X tables of size 2, Y of size 3, Z of size 4.
Bookings available in 3 slots (e.g., 6:30-8pm, 8-9:30pm, 9:30-11pm, each 1.5 hours).
Reservations up to 7 days in advance.
Parties seated only at tables matching or exceeding group size; no splitting parties.
Orders tied to parties/tables; track status transitions.[7][5]
Input/Output Examples
No formal I/O formats like LeetCode-style signatures exist, as this is an OOD verbal/whiteboard exercise. Example scenarios:
Input: Reserve table for party of 3 at 7pm slot on day D+2; later add order: 2 burgers (item ID1), 1 salad (ID2).
Output: Assign table size 3 or 4 if available; return confirmation (e.g., Table T3, Slot 1); update order status to READY after prep.[5]
Edge case: Party of 5 requests table—fail or suggest combining (but typically no combining).[7]
Constraints
Scalability for single restaurant (not multi-location); focus on OOD over HLD.
Handle overlaps (no double-booking slots/tables).
Assume 100s of tables/bookings daily; optimize table allocation (e.g., best-fit).
No payments/ML specified, but extensions may add recommendations (e.g., suggest items based on past orders).[1][5]