System Design · Instacart · Hard
Design a shopping-cart inventory reservation system in which a unit of stock is reserved immediately when a customer adds an item to the cart. The core guarantee is that the system never permits overselling, even when many concurrent purchase attempts target the same product. Your discussion should focus on the persistence layer: identify where each transaction starts and ends, describe the locking strategy, explain possible race conditions, and show how deadlocks are…
Checking your access…