Skip to content
Interview rounds

Databases & caching · Production incident

The database is right, the cache is an hour behind

A cached API sometimes serves an old value long after the data was changed. How do you stop the cache from holding an older value than the database?

BackendSenior12 min
Interview-style scenarioLast reviewed: Checked against official documentation

Thursday 14:30 · listing-serviceIllustrative scenario, not a real incident

Support: 23 reports this week of a listing showing its previous price long after the seller changed it

A marketplace's listing service keeps each listing as JSON in Redis and reads PostgreSQL when the entry is absent. Last week sellers were given a bulk editor, and edits rose from a few hundred a day to about 40 a second at busy times.

In each report the database held the new price, and the API went on returning the previous one. The reports stop by themselves within the hour, and most edits show up at once.

What the dashboards and logs show

Reports
23 this week, none in the month before
Database
holds the new price in every case checked
Edits
about 40 a second at peak, up from a few hundred a day
Affected listings
popular ones, edited more than once within a few seconds

Clarify · optional · scored under "Hypothesis before change"

Ask the interviewer

0 of 3 asked

Each question reveals a fact. What you ask before you act is part of your score.

First move · scored under "Mitigate before root cause"

Buyers are being shown prices that sellers have already changed. What do you do first?

Your rubric score, the model answer, the follow-up questions and the related lessons appear once you have answered the last step.