Design a Restaurant Management System
🍽️ What is a restaurant management system? It is the software a restaurant runs on during service. The host uses it to seat a party at a table. The server uses it to send each order to the kitchen. The kitchen sees a queue of tickets and marks them done, and at the end of the meal the server closes the bill and the table is free for the next party.
You may hear this prompt as "design a point-of-sale system for restaurants, like Toast", "design a restaurant management system" or "design the kitchen side of a restaurant". They are the same design: tables, orders, a kitchen queue and a bill. The POS wording puts more weight on orders and payment, so we cover splitting the bill and tips in Extensibility. The restaurant wording often adds reservations and a waitlist, which we cover there too.
The problem is a good medium because it has three small parts that have to agree with each other: a seating rule, a queue, and a status that every ordered item moves through. Interviewers watch whether you keep each rule in one place, or let the checks leak across every method.
Requirements
"Design a system for a restaurant. Parties get seated at tables, they order food, the kitchen cooks it, and they pay at the end."
That is a lot of ground for one sentence. A real POS also does inventory, staff shifts, menus with modifiers and card payments. Your first job is to cut it down to a core you can finish, and the clarifying questions below do that.
Clarifying Questions
You: How do we pick a table for a party?
Interviewer: Tables have a number of seats. Give the party the smallest free table that fits everyone, so we don't put two people at an eight-top. If several tables of that size are free, take the lowest table number.
You: What does the kitchen see? Is it one queue, or one per station like grill and bar?
Interviewer: One queue for now. Each item a table orders becomes one kitchen ticket. Cooks take tickets in the order they came in.
You: What happens to an item after it is ordered?
Interviewer: It waits in the queue, then a cook starts it, then it is ready at the pass, then a server brings it to the table. A guest can cancel an item while it is still waiting, but not once the kitchen has started it.
You: How is the bill computed? Tax, tips, discounts?
Interviewer: Just the menu price times the quantity, for every item that was served. Cancelled items are free. We can talk about tips and splitting later.
You: Can a table pay while food is still coming?
Interviewer: No. The bill can only be closed when every item is either served or cancelled. Otherwise the kitchen ends up cooking for a table that has left.
You: Do we take the card payment?
Interviewer: No. Return the total; a payment system charges it.
The third answer is the heart of the problem. It describes a life cycle: a fixed set of statuses and the moves allowed between them. Whenever a prompt says "it can do X, but not once Y has happened", write the statuses down and draw the arrows before you write any code.
💡 Interview tip: Ask "can it be cancelled, and until when?" for anything that moves through steps. The answer almost always adds a status and an arrow, and it is the rule interviewers most like to test.
Final Requirements
- The restaurant has a fixed set of tables, each with a number of seats, and a menu of items with prices.
- Seating a party gives it the smallest free table with enough seats; among equal sizes, the lowest table id. If none fits, the party is turned away.
- A seated table can order an item from the menu with a quantity of at least 1. Each order becomes one kitchen ticket with an id, and it is added to the table's bill.
- A ticket moves
QUEUED → COOKING → READY → SERVED. AQUEUEDticket can be cancelled. No other move is allowed. - The kitchen starts tickets in first-in, first-out order across all tables, skipping cancelled ones.
- Anyone can ask for a ticket's status (for the kitchen display and the server's tablet).
- Checking out a table returns the sum of
price × quantityover its served tickets and frees the table. It fails while any ticket is still queued, cooking or ready.
Out of scope
- Card payments, receipts, tax and tips (tips and split bills come back in Extensibility).
- Reservations and a waitlist (Extensibility).
- Menu modifiers ("no onions"), inventory and staff management.
- Several kitchen stations (Extensibility).