1. The “Infinite Scalability” URL Shortener
Scenario: Design a URL shortener (like Bitly) that theoretically handles 1 billion requests per second with zero latency.
Focus:
- Horizontal scaling strategies (sharding, load balancing).
- Trade-offs between consistency (CAP theorem) and availability.
- Stateless vs. stateful services.
Constraint: Ignore legal/security concerns (e.g., malicious links).
2. The “Always Available” Payment System
Scenario: Create a payment processing system that never goes offline, even during server failures or network partitions.
Focus:
- Redundancy (active-active vs. active-passive architectures).
- Idempotency (handling duplicate requests).
- Distributed transactions (Saga pattern, two-phase commit).
Constraint: Assume infinite budget for infrastructure.
3. The “Zero-Latency” Global Social Network
Scenario: Build a social media platform where posts appear instantly to users worldwide.
Focus:
- Geo-replicated databases (eventual vs. strong consistency).
- Edge computing and CDNs.
- Caching strategies (Redis, memoization).
Constraint: Ignore data privacy laws (GDPR, etc.).
4. The “Stateless” Monolith-to-Microservice Transition
Scenario: Split a monolithic application into microservices without downtime.
Focus:
- API gateways and versioning.
- Decoupling dependencies (Strangler Fig pattern).
- Service discovery and inter-service communication (gRPC, REST).
Constraint: Assume all legacy code is perfectly modular.
5. The “Unlimited Storage” File Upload Service
Scenario: Design a system like Dropbox that stores unlimited files with instant search.
Focus:
- Object storage vs. block storage (S3, Blob Storage).
- Metadata indexing (Elasticsearch).
- Deduplication and compression.
Constraint: Ignore storage costs.
6. The “Faultless” Real-Time Chat App
Scenario: Create a chat app where messages never get lost or reordered, even during outages.
Focus:
- Message queues (Kafka, RabbitMQ).
- Event sourcing and CRDTs (Conflict-free Replicated Data Types).
- WebSockets vs. long polling.
Constraint: Assume perfect client connectivity.
7. The “One-Size-Fits-All” Database
Scenario: Design a database that handles both OLTP (high writes) and OLAP (analytical queries) workloads.
Focus:
- Trade-offs between SQL (ACID) and NoSQL (flexibility).
- CQRS (Command Query Responsibility Segregation).
- Data warehousing vs. indexing.
Constraint: Ignore migration complexity.
8. The “Omniscient” Recommendation Engine
Scenario: Build a recommendation system that instantly adapts to user behavior.
Focus:
- Real-time data pipelines (Kafka Streams, Flink).
- Machine learning model serving (TensorFlow Serving).
- A/B testing and feature toggles.
Constraint: Assume infinite compute power.
9. The “Impossible” Elevator Algorithm
Scenario: Optimize elevator movement in a 100-story building with infinite passengers.
Focus:
- State machines and scheduling algorithms.
- Concurrency (handling simultaneous requests).
- Trade-offs between fairness and efficiency.
Constraint: Ignore physics (e.g., elevator speed/weight).
10. The “Unhackable” Authentication System
Scenario: Design a login system immune to all attacks (e.g., brute force, phishing).
Focus:
- Multi-factor authentication (MFA).
- OAuth2/OpenID Connect flows.
- Rate limiting and anomaly detection.
Constraint: Assume users never make mistakes.
How to Use These Exercises:
- Whiteboard First: Sketch components, data flow, and boundaries.
- Identify Trade-Offs: For each decision, ask: What am I sacrificing?
- Iterate: Redesign the system with new constraints (e.g., “Now add a 100ms latency cap”).
- Compare with Real Systems: Study how companies like AWS or Netflix solve similar problems.
By focusing on isolated principles, you’ll build intuition for balancing competing demands (scalability vs. consistency, cost vs. performance, etc.). Happy designing! 🛠️