Skip to main content

Redis data structures, eviction and cache stampede

Which Redis types power rate limiters/leaderboards, how do eviction policies differ, and how do you stop a cache stampede?

Official Reference

Model Answer & Explanation

Use Strings for simple blobs/counters, Hashes for object fields, and Sorted Sets (ZSET) for leaderboards and sliding-window rate limits. Set maxmemory with allkeys-lru (cache anything) or volatile-lru (evict only keys with TTL). Prevent stampedes when a hot key expires using per-key mutex/singleflight, probabilistic early refresh, or stale-while-revalidate.

Follow-up Interview Question · Compare Redis RDB snapshots vs AOF persistence for durability vs performance.

Module Context & References

PostgreSQL & Redis · Popular interview theory High-yield indexing, MVCC, query plan and Redis caching questions
Personal Notes · Markdown

Technologies & Interview Topics Covered

Switch between short-term interview tracks and long-term 80/20 engineering depth to practice JavaScript internals, React rendering and hooks, timed frontend machine coding UI challenges, MeetaPro FG300, Blind 75 & NeetCode 150 DSA patterns, Python & FastAPI APIs, PostgreSQL query optimization & MVCC, Redis caching, Applied AI RAG pipelines & evaluations, and distributed system design.