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?
- A. The database write failed; retry it
- B. The CDN is down; disable caching
- C. Users' browsers are broken; ask them to refresh
- 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.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A service spreads 6 instances across 3 availability zones in one region (2 per zone) and needs at least 4 instances running to handle peak…
- A test in the CI suite passes and fails randomly on the same commit because it depends on timing. Developers have started re-running…
- A call hierarchy has 6 modules: M1 calls M2 and M3; M2 calls M4 and M5; M3 calls M6. Using the usual counts (top-down needs a stub for…
- A developer fixes a login bug. The tester first checks that the reported bug is really gone, then re-runs a set of existing login and…
- Match each performance test with its purpose. P: load test. Q: stress test. R: soak (endurance) test. S: spike test. 1. Run at normal load…
- In a closed-loop load test, 300 virtual users each wait a think time of 5 seconds between requests, and the measured throughput is 40…