
A Senior Software Engineer candidate had 9 years of experience building distributed applications. His resume mentioned microservices, Kafka, Redis, PostgreSQL, Kubernetes, and high-scale backend systems. So I asked him to design a simple service. 𝐏𝐫𝐨𝐛𝐥𝐞𝐦: Design an inventory management system for a major e-commerce platform. During a flash sale, 100,000 users might try to buy the last 500 units of a product. The system must prevent overselling. 𝐂𝐚𝐧𝐝𝐢𝐝𝐚𝐭𝐞'𝐬 𝐚𝐧𝐬𝐰𝐞𝐫: I'll use Redis to cache inventory counts and Kafka to process orders asynchronously. Redis is fast, so the system should handle the traffic. A decent starting point. But then I asked: Two customers purchase the last available unit at the same time. Both requests read inventory as 1. Both proceed to checkout. How do you guarantee that only one order succeeds? He said: "I'll increase Redis capacity and use a distributed cache." So I pushed further. How would you make inventory reservation atomic? Would Redis alone be your source of truth? What happens if payment fails after inventory is reserved? How would you prevent duplicate orders during retries? How do you reconcile inventory after a partial failure? He could name the technologies. But he couldn't explain concurrency control, atomic operations, idempotency, or consistency. That's when the gap became obvious. Scaling isn't just about handling more requests per second. It's about maintaining correctness when thousands of requests arrive at the same time. A system that processes 100,000 requests but sells 600 units when only 500 exist isn't scalable. It's broken. Would you approve this design for a real flash sale?









