Code Room
System designMedium
Question
Design a simple inventory tracker for a small online store. Each product has a quantity in stock. When an order is placed you must decrement stock, and you must not let two simultaneous orders both buy the last unit (oversell). Order volume is modest but occasional bursts happen during sales. Describe the data model and how you keep stock counts correct under concurrent orders.
What a strong answer looks like
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.
Learn the concepts
Loading whiteboard…
Run or narrate your approach, then ask the coach.