Design an inventory management system
InstacartSoftware Engineer · OnsiteLast updated
This question evaluates competency in system design, data modeling, distributed consistency, concurrency control, API design, idempotency, and scalability for backend inventory and reservation workflows.
Design an inventory management system for an e-commerce business.
The system must support:
- Updating stock when inventory is received, adjusted, or sold.
- Reserving items when a shopper starts checkout (to prevent overselling).
- A “shopper collects items” workflow (e.g., curbside pickup / warehouse picking): an API call that marks items as collected/picked and updates inventory accordingly.
Focus areas:
- Database schema design.
- Achieving high consistency (avoid overselling, correct reservation handling under concurrency).
- Core APIs and their request/response semantics.
- Handling race conditions, retries, and idempotency.
- Reasonable scaling approach (multiple SKUs, multiple warehouses/locations).
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.