Interview Q&A / System Design
System Design interview questions
Caching, scaling, databases and classic design problems for beginners.
Prefer rapid revision? Practise System Design short interview answers →
- What is caching and what caching strategies should you know?
A cache keeps a copy of frequently used data in faster storage, like memory, so repeated reads are quick. Know cache-aside, write-through and write-back, eviction policies like LRU, TTLs, and the hard part, keeping the cache consistent with the database.
BeginnerIn-depth3 min read - How does a CDN work and what does it improve?
A CDN keeps copies of your content on servers near users around the world. A user is routed to the closest edge, which serves cached content quickly and only contacts your origin server on a miss.
BeginnerQuick answer1 min read - How does the cache-aside pattern work?
The application checks the cache first. On a miss it reads the database, stores the result in the cache and returns it. On writes it updates the database and removes or updates the cache entry.
BeginnerQuick answer1 min read - What is the difference between LRU and LFU cache eviction?
LRU evicts the item not used for the longest time. LFU evicts the item used the fewest times. LRU favours recency and is the common default; LFU favours long-term popularity but is slower to adapt.
BeginnerQuick answer1 min read