Design an inventory and order management system
The interviewer asks you to keep a shop's stock and its orders in step. Picture a stockroom with a numbered shelf for each product, and on each shelf a card with two numbers: how many are there, and how many are promised. A clerk with an order list collects the key to each shelf, lowest number first. Once she holds every key, she reads every card, and she writes on them only if every item is free.
It is also asked as "design a warehouse stock system". The closest other case study is movie ticket booking, where one request stays within one show's lock. Interviewers like this one because "all or none" must hold across several objects while other orders run.
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 inventory and order management for an online shop.
You: What is in an order, and can I ship part of it?
Interviewer: Several products, with a count of each. If one product is short, the whole order is refused.
You: When is stock set aside, at placing or at paying?
Interviewer: When it's placed. We never want to take money for something we can't send.
You: Which moves can an order make?
Interviewer: Placed, paid, shipped, delivered, and cancelled until it ships.
You: How big is it, and do orders arrive at the same time?
Interviewer: One warehouse and about 10,000 products. Many checkout threads run at once in one process.
You: Does anyone else need to hear about changes?
Interviewer: The warehouse wants a log of every order change and every stock change.