Interview practice question
Cache stampede on a hot key
Backend Engineering · NoSQL and Redis · Intermediate
When a popular cached item expires, hundreds of requests hit the database at once. How do you prevent this in your code?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Lock/single-flight on rebuild.
- SET NX lock key while rebuilding.
- Others wait or serve stale.
- Early refresh / soft TTL.
- Jittered TTLs.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.