0
0
HLDsystem_design~5 mins

Cache eviction policies (LRU, LFU, TTL) in HLD - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does LRU stand for in cache eviction policies?
LRU stands for Least Recently Used. It evicts the cache item that has not been used for the longest time.
Click to reveal answer
beginner
Explain LFU cache eviction policy.
LFU stands for Least Frequently Used. It removes the cache item that has been accessed the fewest times.
Click to reveal answer
beginner
What is TTL in cache eviction and how does it work?
TTL means Time To Live. It sets a fixed time limit for cache items. After this time, the item expires and is removed.
Click to reveal answer
intermediate
Which cache eviction policy is best when recent data is more important?
LRU is best when recent data is more important because it keeps the most recently used items in cache.
Click to reveal answer
intermediate
Why might LFU be less effective in some scenarios compared to LRU?
LFU can keep rarely used but frequently accessed old data, which may waste cache space. LRU adapts better to changing access patterns.
Click to reveal answer
Which cache eviction policy removes the item that was used least recently?
ALRU
BLFU
CTTL
DRandom
What does LFU prioritize when evicting cache items?
AItems with the oldest timestamp
BItems used most recently
CItems used least frequently
DItems with the shortest TTL
TTL cache eviction is based on which factor?
AFrequency of access
BRecency of access
CCache size limit
DTime elapsed since insertion
Which eviction policy is best for caching session data that expires after a fixed time?
ATTL
BLRU
CLFU
DRandom
If a cache keeps frequently accessed old data but ignores recent data, which policy might it be using?
ALRU
BLFU
CTTL
DFIFO
Describe the differences between LRU, LFU, and TTL cache eviction policies.
Think about how each policy decides which item to remove.
You got /4 concepts.
    Explain when you would choose LRU over LFU or TTL for cache eviction in a system.
    Consider what kind of data your system uses most.
    You got /4 concepts.