Algorithms and Data Structures · Senior · Question 39 of 75

When does LFU beat LRU as a cache eviction policy?

Explanation

One big scan can push all hot items out of an LRU cache. LFU keeps frequently used items, but adapts slowly when popularity shifts. Modern caches (W-TinyLFU in Caffeine) combine recency and frequency.

Further reading

Problem with a question

Algorithms and Data Structures · Senior · question 39

Test yourself

Take the Algorithms and Data Structures · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz