Design scalable, reliable systems — the skill that separates senior from junior engineers.
System design is about making high-level architectural decisions.
Key concepts to master:
1. Scalability
- Vertical scaling (bigger machine) vs horizontal scaling (more machines)
- Load balancing: round-robin, least-connections, consistent hashing
- Stateless services — any instance can serve any request
2. Data Storage
- SQL vs NoSQL trade-offs
- Sharding: range-based, hash-based, directory-based
- Replication: master-slave, multi-master
- CAP theorem: Consistency, Availability, Partition Tolerance (pick 2)
3. Caching
- CDN for static assets
- Application cache (Redis/Memcached)
- Database query cache
- Cache invalidation strategies
4. Messaging
- Message queues (async processing): RabbitMQ, SQS
- Event streaming (replay, multiple consumers): Kafka
5. APIs
- REST vs GraphQL vs gRPC
- API gateway for auth, rate limiting, routing
- WebHooks vs polling vs WebSockets vs SSE
6. Common system design problems:
- URL shortener, Twitter feed, YouTube, WhatsApp
- Ride-sharing, food delivery, notification system
- Design patterns: read-heavy (cache), write-heavy (async queues), search (ElasticSearch)
Framework for interviews:
1. Clarify requirements (functional + non-functional)
2. Estimate scale (DAU, QPS, storage)
3. High-level design (boxes and arrows)
4. Deep dive on 2-3 components
5. Address bottlenecks
Key concepts to master:
1. Scalability
- Vertical scaling (bigger machine) vs horizontal scaling (more machines)
- Load balancing: round-robin, least-connections, consistent hashing
- Stateless services — any instance can serve any request
2. Data Storage
- SQL vs NoSQL trade-offs
- Sharding: range-based, hash-based, directory-based
- Replication: master-slave, multi-master
- CAP theorem: Consistency, Availability, Partition Tolerance (pick 2)
3. Caching
- CDN for static assets
- Application cache (Redis/Memcached)
- Database query cache
- Cache invalidation strategies
4. Messaging
- Message queues (async processing): RabbitMQ, SQS
- Event streaming (replay, multiple consumers): Kafka
5. APIs
- REST vs GraphQL vs gRPC
- API gateway for auth, rate limiting, routing
- WebHooks vs polling vs WebSockets vs SSE
6. Common system design problems:
- URL shortener, Twitter feed, YouTube, WhatsApp
- Ride-sharing, food delivery, notification system
- Design patterns: read-heavy (cache), write-heavy (async queues), search (ElasticSearch)
Framework for interviews:
1. Clarify requirements (functional + non-functional)
2. Estimate scale (DAU, QPS, storage)
3. High-level design (boxes and arrows)
4. Deep dive on 2-3 components
5. Address bottlenecks