System Design

Caching

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

  • We run a content site with images and articles, and read traffic is mostly global. How would you use a CDN and edge caching to cut latency and origin load, and what content can't be cached that way? Mid level
  • A single popular cache key expires under heavy traffic and your database gets hammered by a flood of simultaneous misses. How do you prevent that, and how do you handle a key so hot it overloads one cache node?Go Pro Senior level
  • When you put a cache in front of a database, how do you decide between cache-aside, write-through, and write-back, and how do you keep the cache from serving stale data?Go Pro Senior level
  • Walk me through how you'd design the caching layer for a read-heavy product catalog: which caching pattern you'd use, where the cache sits, and how you keep it from serving stale data when a price changes.Go Pro Staff-principal level
  • A single viral item — a celebrity's profile, one trending product — concentrates a huge share of read traffic onto the one cache node that owns its key. How do you keep that hot key from overwhelming a node, and how do you handle the stampede when it expires?Go Pro Staff-principal level
  • Design a caching layer to speed up a read-heavy product catalog. How do you decide what to cache and how do you keep it from serving stale data?Go Pro Mid 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.