CS FundamentalsHardProduct-company system-design interview

A product page is served using cache-aside with a 10-minute TTL. An admin updates a price in the database, and for several minutes some users still see the old price. What is happening, and which fix is most targeted?

  1. A. The database write failed; retry it
  2. B. The CDN is down; disable caching
  3. C. Users' browsers are broken; ask them to refresh
  4. D. The cache still holds the stale entry until the TTL expires; delete (invalidate) the key when the price is written

Correct answer: D. The cache still holds the stale entry until the TTL expires; delete (invalidate) the key when the price is written

In cache-aside the app reads from the cache and fills it on misses; nothing removes an entry when the database changes. Invalidating on write (or a shorter TTL for volatile data) fixes the staleness.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic