Caching interview question

After adding a Redis cache, users sometimes see stale or wrong data. How do you investigate and fix it?

Scenario Asked in Backend Engineer · Full Stack Engineer interviews

Members can save this page, take notes and track progress. See membership · Sign in

Summary

Find how entries become stale: writes that don't invalidate the cache, a race between a slow read repopulating the cache with old data after an update, keys that don't include everything the result depends on (user, locale, permissions), or TTLs longer than the data can tolerate. Fix with invalidation on write, correct keys, shorter TTLs or versioned keys.

Keep reading with a membership

The full answer with examples, key points and comparisons is part of the membership, along with every other interview answer, progress tracking and Daily Review. Most-asked answers stay free to read.

See plans and free trial Already a member? Sign in

More Caching questions

← All Caching questions

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake