System design je nejtěžší část senior pohovorů. Ale dá se na to připravit.
Framework (4 kroky)¶
- Requirements — funkční a nefunkční (scale, latency, availability)
- High-level design — hlavní komponenty a data flow
- Deep dive — detaily kritických komponent
- Bottlenecks & trade-offs — škálování, failure scenarios
Klíčové koncepty¶
- Load balancing (L4 vs L7)
- Caching (CDN, Redis, application cache)
- Database (SQL vs NoSQL, sharding, replication)
- Message queues (async processing)
- Consistent hashing
- CAP theorem
- Rate limiting
- API Gateway
Typická zadání¶
- URL shortener (TinyURL)
- Chat systém (WhatsApp/Slack)
- Social media feed (Twitter/Instagram)
- Video streaming (YouTube/Netflix)
- Ride sharing (Uber)
- Search engine
Příklad: URL Shortener¶
- Requirements: 100M URLs/den, read-heavy (100:1)
- API: POST /shorten, GET /:shortCode → redirect
- Storage: 100M × 1KB = 100 GB/den
- Hash function: base62 encode
- Database: sharded by shortCode
- Cache: Redis pro hot URLs
- CDN pro redirect
Zdroje¶
- System Design Primer (GitHub)
- Designing Data-Intensive Applications (kniha)
- ByteByteGo (YouTube)
- system-design.com
Tip¶
Mluvte nahlas, ptejte se na requirements, kreslete diagramy. Interviewer hodnotí váš thought process, ne perfektní řešení.
system designpohovorarchitektura