Caching
Difficulty: Easy | Topic #3
What to Learn
Cache-aside pattern with Redis/Memcached, write-through vs write-back, eviction policies (LRU, LFU, TTL), cache invalidation strategies, cache stampede prevention, CDN caching for static assets.
Resources
- Hello Interview: Caching ↗
- ByteByteGo: Cache Systems Every Developer Should Know ↗
- ByteByteGo: Caching Pitfalls Every Developer Should Know ↗
Covered by Problems
| Problem | Difficulty | Link |
|---|---|---|
| URL Shortener/Bitly | Easy | → |
| Distributed Cache | Medium | → |
| FB News Feed | Medium | → |
| YouTube | Medium | → |
| Top K | Hard | → |
Key Concepts to Master
- Cache-aside vs read-through vs write-through vs write-behind
- LRU vs LFU eviction algorithms
- Cache stampede and probabilistic early expiry fix
- Multi-layer caching (L1 in-process, L2 Redis, L3 CDN)
- Cache warm-up strategies