AI Hints
Home›System Design Tutorial›Redis and Cache Layers
System Design · Lesson 63 of 120

Caching Quiz

Test yourself.

⏱ 2 min read▶ Video at 1:15:02🎓 Free
Watch this lesson in the System Design courseWatch on YouTube ↗Full System Design course

Let's review caching. Pause after each question, and answer before I do.

Caching Quiz
From the video: Caching Quiz
  • Caching quiz
  • Pause and think
  • Then check

Question 1

The app checks the cache, and on a miss, loads from the database and fills the cache. What's this pattern called? Cache aside.

Quick check
Check cache, fill on miss:

Question 2

The cache is full. Which policy removes the item unused for the longest time? LRU.

Quick check
Remove the least recently used:

Question 3

A hot key expires, and thousands of requests hit the database at once. What's that called? A cache stampede.

Quick check
Thousands of misses at once:

Question 4

Which Redis type suits a leaderboard? A sorted set.

Quick check
A leaderboard in Redis:

Summary

Great job. Next, a new section on asynchronous work and messaging, starting with sync versus async.

Key takeaways
  • Cache-aside
  • LRU
  • Sorted sets
Next up: Sync vs Async — wait or not