Caching interview questions
100 System Design practice questions. Read what a strong answer covers, then practise it out loud against the clock.
Practise Caching questionsBeginner
- Adding your first cache
- API overwhelmed by public data requests
- Browser caching
- Cache eviction policies
- Cache hit rate
- Cache invalidation
- Cache keeps evicting useful data
- Cache-aside pattern
- Caching a product page
- Caching a third-party API
- Caching configuration data
- Caching sessions
- Can a CDN cache dynamic content?
- Choosing an eviction policy
- Choosing TTLs for different data
- Cold cache and cache warming
- Cost of caching
- Database buffer cache
- Designing cache keys
- How a CDN caches content
- Local vs distributed cache
- Negative caching
- Redis goes down
- Redis vs Memcached
- Stale data trade-off
- Static assets cached forever
- TTL in caching
- Users see old prices
- Users see someone else's account
- What should you cache?
- Where caches can live
- Why caching matters
- Write-back caching
- Write-through caching
Intermediate
- Bots request random product IDs
- Cache leases
- Cache penetration vs cache avalanche
- Cache reads are surprisingly slow
- Cache stampede
- Caching a 5 MB object
- Caching a mostly-static page with personal bits
- Caching for a global audience
- Caching search results
- Caching token validation
- Caching view counts
- CDN cache keys and query strings
- CDN still hammers the origin
- Designing a two-level cache
- Detecting hot keys
- ETags and conditional requests
- Event-driven cache invalidation
- High availability for caches
- Homepage key expiry spikes the database
- How a distributed cache spreads keys
- Near cache in microservices
- New cache cluster migration
- Profile updates appear slowly
- Purging bad content from the CDN
- Read-through caching
- Redis persistence options
- Refresh-ahead caching
- Should you cache stock levels?
- Stale-while-revalidate
- TTL jitter
- Using Redis for rate limiting
- What format to store in a cache
- What to monitor on a cache
Experienced
- Cache admission policies
- Cache and strong consistency
- Cache bill is too high
- Cache flush causes an outage
- Cache recovers but reconnect storm hits
- Cache replication across regions
- Caching a social feed
- Caching analytics queries
- Caching computed results vs raw data
- Caching for a GraphQL API
- Caching for a write-heavy workload
- Caching permissions safely
- Caching personalised prices
- Caching video segments at the edge
- CDN cache poisoning
- CDN serving outdated API versions
- Collaborative app with cached documents
- Content-addressed caching
- Edge key-value stores
- Keeping multi-layer caches coherent
- Memory grows without bound
- One cache shard fails
- One tenant fills the shared cache
- Probabilistic early expiration
- Redis as a primary database
- Request coalescing
- Sizing a cache cluster
- Stale value written back after invalidation
- Testing caching logic
- The cache became critical
- Update the cache or delete the key?
- Using multiple CDNs
- When not to cache