Skip to the guide

Design food ordering (like DoorDash or Swiggy)

IntermediateCase study11 pages

The interviewer asks you to design the classes behind a food-ordering app. Picture a takeaway that still runs on paper, where each order is one slip with boxes to stamp. The kitchen stamps "accepted" and "ready", the rider stamps "collected" and "delivered", and nobody may stamp a box that isn't theirs. The back of the slip says what you get back if the order is cancelled at each stage. Every stamp rings a bell, and whoever cares looks up.

The closest other case study is cab booking. Interviewers like it because three parties touch one order and money can flow back. This page keeps to one program, and food delivery owns the system at scale.

Below is a full 45-minute round on the LLD framework. At each Guess before you read on, stop and answer first. The full runnable project is a download in Java, JavaScript and Python.

Run the full project

This design as a project you can run, with its tests and a demo. You only need Java 21, Node 24 or Python 3.13. The README says how to run it.

Step 1 · Clarify the requirements and cut the scope

Minutes 0–5 · How this step works

Interviewer: Design food ordering.

You: Who uses it, and can one order span two restaurants?

Interviewer: Customers, restaurants and couriers. One order comes from one restaurant.

You: How do customers find a restaurant?

Interviewer: They pick a cuisine and a minimum rating, and see the best rated first.

You: How is delivery priced?

Interviewer: $2, plus $1 per km started, plus $2 more if the food comes to under $10. Restaurants will want their own deals later.

You: Is payment part of this, and who can cancel?

Interviewer: A card is charged when the order is placed, through an outside service. The customer can cancel until the courier collects. She gets back all of the food's price at first, half once the kitchen accepts, and none once it's ready. The delivery fee always comes back. If the restaurant or courier cancels, she gets everything.