AdvancedSystem-Design
45 min
Design an E-commerce Checkout & Cart
Advertisement
Interview Question
Design a highly available checkout/cart system handling flash sales, inventory reservations, payments, and order confirmation.
Key Points to Cover
- Cart service with session/identity; cache hot carts
- Inventory reservation with short TTL and oversell prevention
- Payment orchestration with idempotency keys and retries
- Order pipeline, outbox pattern, and eventual consistency
- Anti-fraud checks, rate limits, and SLOs for peak events
Evaluation Rubric
Robust cart & session design20% weight
Safe reservations & oversell control30% weight
Idempotent payment orchestration30% weight
SLOs, retries, and observability20% weight
Hints
- 💡Model reservations explicitly, not as decrements.
Common Pitfalls to Avoid
- ⚠️Underestimating the read/write load during flash sales, leading to database contention.
- ⚠️Race conditions in inventory updates, resulting in overselling during high concurrency.
- ⚠️Lack of proper idempotency in payment processing, leading to duplicate charges.
- ⚠️Synchronous workflows that block user requests and create bottlenecks.
- ⚠️Inadequate caching strategy, leading to overwhelming the backend services with requests.
Potential Follow-up Questions
- ❓How do you handle partial payment failures?
- ❓How would you implement cart merge across devices?
Advertisement
Related Questions
Questions that share similar topics with this one
Design a URL Shortener (TinyURL)
Advanced🏗️ System Design•45 min•System-Design
Design a Social News Feed
Advanced🏗️ System Design•45 min•System-Design
Handling Distributed Cache Invalidation
Advanced🔬 Technical Deep Dive•5 min•Technical
PostgreSQL Replication Lag Troubleshooting
Advanced🔬 Technical Deep Dive•5 min•Technical
Exactly-Once Effects with the Outbox Pattern
Advanced🔬 Technical Deep Dive•5 min•Technical