Backend Engineering

Caching

6 practice questions. Free questions open a full answer guide; the rest unlock with Pro.

  • A popular cache key expires and your database suddenly gets hammered by a flood of concurrent requests all trying to recompute the same value. What is this, and how do you prevent it? Mid level
  • When you put a cache in front of a database, how do you decide on a write strategy, and how do you keep the cache from serving stale data?Go Pro Mid level
  • Why is choosing a cache TTL tricky, and what's the cache stampede problem when a popular entry expires?Go Pro Junior level
  • Your read-heavy service uses a distributed cache in front of the database. When a hot key expires, the database briefly gets slammed by a flood of identical requests. Beyond just raising the TTL, how would you design the caching layer to prevent this at scale?Go Pro Senior level
  • Walk me through how you decide between write-through, write-behind, and cache-aside for a given workload, and how each choice affects consistency between the cache and the source of truth.Go Pro Senior level
  • What is caching, where would you add one in a typical web application, and how do you decide what to cache?Go Pro Junior level
Want questions matched to your role? Paste a job title, job description, or CV for a personalized set, or go Pro to unlock the full bank.