Skip to content

Build a Lunch Order Book

Davor Minchorov•Beginner•1 to 2 weekends•November 19, 2026

A one-person kitchen cooks 30 lunch boxes a day and keeps saying yes to more orders than it can cook. You will build the order book that says no for her when the day is full or the cutoff has passed, and that hands her a sheet of what to cook and where to deliver.

The brief

The client

I cook lunch boxes in my own kitchen in Amsterdam for two office buildings nearby, and I deliver them myself on a bike. I can cook 30 boxes a day from three dishes, and I take orders as chat messages that I count in a notes app.

Last Tuesday I said yes to 41 people before I did the sums. I spent the morning writing sorry to 11 of them, and two had already told their team that lunch was sorted. I do not need an app store listing. I need one place where I enter tomorrow's dishes and portions, people order against it, and it says no when the day is full or the order is too late. I stop taking orders for a day at 09:30 that morning, because I start cooking soon after.

The problem

Every yes in a chat is a promise to cook and carry a box, and she makes it from a running count in her head. A miscount means she cooks more than her kitchen allows, or she breaks a promise to someone who planned their lunch around it. Eleven apologies cost her a morning of cooking time, and each broken promise costs a customer she cannot easily win back.

She also cannot tell later what she charged a person, because she edits her prices in the same notes app. At the end of the day she adds up the cash by hand from scrolling chats.

The client's name and figures are invented for this brief; the rules and the failures are ones that real businesses of this kind work with.

The spec

Requirements

  • Enter a day's menu: the dishes, a price for each dish, the portions she will cook of each, and the cutoff time after which no order is taken for that date.
  • Change the price of a dish.
  • Show a customer a day's menu with the portions still left for each dish.
  • Place an order for a date with one or more lines, and accept it only if every line fits in the portions left and the cutoff has not passed. Otherwise refuse it with a reason the customer can read, and change nothing.
  • Keep the price each customer was charged on their own order, so a later price change does not alter an earlier order.
  • Cancel a placed order before the cutoff and give its portions back. Refuse a cancel after the cutoff.
  • Give the client a kitchen sheet for a date: how many of each dish to cook, and each order with name, phone number, delivery spot and the total to collect.
  • Mark an order delivered, and show the cash collected on a date, which is the sum of the delivered orders only.
  • Let the person or the request supply the current time for an order or a cancel, so the cutoff can be tried at 09:29 and 09:31 without waiting. This exists for testing.

Deliverables

  • A running program with your own choice of interface: a web page, an API that other programs call by sending requests, or a command-line tool. It keeps its data when it is closed and started again.
  • A README that takes a reviewer from an empty data store to a finished day in 10 minutes, with the steps to enter a menu, place orders and read the kitchen sheet.
  • A document of at least 8 example days, each with a starting menu, one order or cancel and the expected answer.
  • An automated test set, code that drives the program and checks its answers against the expected ones, that runs every example day with one command and shows which examples pass.
  • A script or written walk-through of a whole day with the cash collected worked out by hand beforehand.

Out of scope

  • Accounts and logins. A name and a phone number on the order are enough for 30 boxes a day. Do not put this tool on the internet, because anyone who can reach it can read every customer's phone number and cancel any order.
  • Card payments. Customers pay cash on delivery, so no order has a paid state.
  • Two people ordering the last portion at the same moment. One order at a time is enough here.
  • More than one kitchen, or menus owned by several restaurants. One kitchen keeps the rule checkable.
  • Couriers, dispatch and live tracking. The client is the courier.
  • Notifications. She texts the customer herself.
  • Delivery fees, tax, tips, discounts and promotions. Each is a pricing rule of its own, and this project is about the portions rule.
  • Waiting lists for a sold-out day. A waiting list is a second rule on top of the first.
  • Repeating weekly menus and opening hours. A menu is typed in for each date.
  • Allergen filtering. It is a legal topic in its own right.

Architectural constraints

  • Amounts are exact to the cent: people see 9.50, and no sum of prices is ever off by a cent.
  • A cutoff is 09:30 Amsterdam time (Europe/Amsterdam), whatever the time zone of the machine running the program.
  • The person or the request can supply the current time for an order or a cancel, for testing. The real time is used when none is supplied.
  • A refused order changes nothing, including the lines that would have fit.
  • Saved data survives closing and restarting the program.
  • An order keeps the price it was charged, whatever the price list says later.
  • A quantity is a whole number of 1 or more, and an order has at least one line.

Prerequisites

You can write a small program in a language of your choice and have saved data to a database or a file once. You do not need to know how an ordering system works or any particular framework. You do not need to know how a home kitchen sells lunch boxes; the first Phase explains the business and the words the brief uses. Having written one automated test helps.

Create a free accountSign in

Free to start. An account is what keeps track of the checkpoints you finish.

Phase 1

Set up one day's menu

Produces a written set of example days, a saved day menu the client can enter, and a menu a customer can read with the portions left. No ordering yet.

Research

Implementation

Implementation

Architectural walkthrough

How a home kitchen sells lunch boxes

One cook prepares lunch boxes in her own kitchen in Amsterdam for two nearby office buildings. She can cook 30 boxes a day, from three dishes, and she brings them to the buildings herself on a bike. Customers are people in those offices who order by chat message. Each box is a portion of one of the day's dishes.

She decides the menu for a day ahead of time: which dishes, a price for each, and how many portions of each she will cook. Orders for a date stop at 09:30 that morning, because she starts cooking soon after. Customers pay cash when the box is handed over. At the end of the day she needs to know how many of each dish to cook and what to collect from whom.

The words this brief uses:

  • Menu: the dishes for one date, each with a price and a number of portions.

  • Portion: one box of one dish. A dish with 10 portions can be ordered 10 times.

  • Cutoff: the time on the morning of a date after which no order for that date is taken.

  • Order line: one dish and a number of portions inside an order.

  • Kitchen sheet: the list for one date of how many of each dish to cook and which orders to deliver.

  • Cash on delivery: payment in cash when the box is handed over.

  • Delivery spot: where the box is to be handed over.

Why the rules come first

This Phase has to survive two quiet failures: a price that drifts and a cutoff that moves.

Both are settled before any order exists, because every later Checkpoint depends on them.

The first Checkpoint is a document: the kitchen's rules, including the hard cases such as an order at the exact cutoff, get an answer chosen calmly before any order arrives.

Phase 2

Take orders that respect the day

Produces orders that are accepted or refused by the day's rule, priced from the menu and cancellable, with the example days from Phase 1 running as automated tests. The kitchen sheet and delivery wait for the next Phase.

Implementation

Implementation

Implementation

Implementation

Testing

Architectural walkthrough

This Phase has to survive four failures: the order that half fits, a cancel that gives portions back twice, a price change that rewrites old orders, and a cutoff nobody tries at 09:29 and 09:31.

The Phase ends by turning the example days into automated checks, so the rule holds when the program changes.

Phase 3

Hand the cook a sheet and close the day

Produces the kitchen sheet, delivery, the cash collected figure and a run of a whole day from an empty store. No new rule about the day is added.

Implementation

Implementation

Testing

Architectural walkthrough

This Phase has to survive a kitchen sheet and a cash figure that disagree with the orders behind them.

The final Checkpoint runs a whole day from an empty start and compares the result with a total added up by hand first. If the program and the arithmetic disagree, one of them has a mistake, and finding which one is the point of the exercise.

Architectural walkthrough

The day answers for every order before it

Whether the kitchen can take 2 more portions of dish B depends on every order already placed for that date, on every cancel, and on the clock. A form that saves rows has no memory of any of that. This project turns on one rule: an order is accepted only if every line fits in the portions left and the cutoff has not passed, and a refused order changes nothing at all.

The order that half fits

Take an order of 2 of dish A, 11 of dish B and 1 of dish C on a day with 10 portions of each. B cannot be met, so the order is refused. If the 2 portions of A are still gone afterwards, dish A shows 8 left and nobody owns the missing 2. The cook sees a fuller day than she has and leaves two boxes uncooked and unsold. Two people ordering the last portion at the same moment is a separate problem, and this project leaves it out on purpose.

The clock and the zone

A cutoff of 09:30 means nothing until it says where. A program running on a server in another time zone cuts off an hour early or late, and nobody notices until a customer complains. The client's cutoff is 09:30 in Amsterdam, wherever the program runs.

The cutoff is also hard to check. If the only way to see what happens at 09:29 and 09:31 is to wait for the real time to pass, it is never checked, and the first real test is a customer who ordered one second late. The person or the request can supply the current time, for testing.

The price she charged

Her price list changes, and what she charged must stay what she charged. If an old order follows today's price, raising a price by 50 cents rewrites last week's orders and the cash collected figure moves with it.

Where it shows if you cut a corner

Three symptoms show a cut corner. A day that shows fewer portions than were sold means a refused order kept part of its change. A cutoff check that passes on your laptop and fails on a friend's means the time zone came from the machine. A cash figure that moves after a price change means an old order followed the price list. The whole-day run in the last Checkpoint exposes each of them, because its total is added up by hand before the program touches it. Once this works, the next step up in this domain is Build a Delivery Desk for a Pizzeria.