Interview Q&A · questions with model answers

Caching Interview Questions

Part of the study plan for: Backend Engineer · Full Stack Engineer

Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.

  1. Most asked Why is cache invalidation hard, and what strategies help?

    Invalidation is hard because data changes in many places, caches are distributed, and races between reads and writes can repopulate stale values. Strategies: TTLs as a safety net, delete-on-write,…

  2. Why can a Redis failover bring back deleted (stale) cache entries?

    Redis replication is asynchronous; DELs acknowledged by the old primary may not reach the promoted replica, resurrecting stale values for their full TTL. After failovers, bump generations or flush…

  3. Why are database query caches often disabled or removed?

    Generic query caches (like MySQL's old query cache) invalidate all cached results for a table on any write, causing contention and poor hit rates on write-heavy workloads; MySQL 8 removed it.…

  4. Why add jitter to cache TTLs?

    Keys written together with the same TTL expire together, creating a miss storm. Random jitter (±10–20%) spreads expiries out.

Was this page helpful?

Report a mistake