System Design Problems
Design Amazon
Amazon serves 300M+ active users with 350M+ products. This design covers product catalog with search, shopping cart, checkout with inventory management, and order fulfillment.
- Scale â 300M+ users, 350M+ products, 66K orders/hour
- Availability â Must handle Prime Day spikes (10x normal)
- Inventory â Real-time stock tracking across 175+ fulfillment centers
Amazon's core challenge is building a resilient e-commerce platform that handles extreme traffic spikes while maintaining inventory accuracy.
Requirements Clarification
Functional Requirements
- Search products with filters and sorting
- View product details with reviews
- Add to cart and checkout
- Order tracking and management
- Inventory management
- Recommendation engine
- Seller marketplace
Non-Functional Requirements
- Availability: 99.99% uptime
- Latency: Search < 200ms, Checkout < 2s
- Consistency: Strong for inventory and payments
- Scale: 66K orders/hour, 10x on Prime Day
Back-of-the-Envelope Estimation
High-Level Architecture
Inventory Management
Checkout Flow: The Two-Phase Commit
Product Search
Data Model
Practice Exercises
- Inventory: Design a distributed inventory system that prevents overselling across 175 fulfillment centers.
- Cart: How would you handle a user adding an item to cart that goes out of stock before checkout?
- Search: Design a search system for 350M products with < 200ms latency.
- Prime Day: How would you handle 10x traffic on Prime Day without over-provisioning?
What to Learn Next
-> Design Dropbox File sync and storage systems.
-> Design Google Search Web-scale indexing and ranking.
-> Saga Pattern Distributed transactions.
-> Idempotency Handling duplicate requests safely.
-> Outbox Pattern Reliable event publishing.
-> Circuit Breaker Preventing cascade failures.