Compare common cache eviction policies: LRU and LFU; discuss when each is advantageous.

Prepare for the Veritas Qualifying Exam with comprehensive quizzes featuring multiple-choice questions, detailed explanations, and useful tips. Master the exam material and boost your confidence!

Multiple Choice

Compare common cache eviction policies: LRU and LFU; discuss when each is advantageous.

Explanation:
The main idea here is how eviction decisions use recency versus frequency to decide what to throw away. LRU (least recently used) evicts the item that hasn’t been used for the longest time. The logic is that if something was accessed recently, it’s likely to be accessed again soon because workloads often show temporal locality—recently used items tend to come back into use. LFU (least frequently used) evicts the item with the lowest access count. The idea is that items that have been accessed often are likely to be accessed again, so keeping those “hot” items around is beneficial when the workload has stable, long-term popularity. Thus, LRU shines when the workload exhibits temporal locality and patterns change over time; it adapts to recent behavior. LFU shines when there are a few consistently popular items and access patterns are stable enough that frequency is a good predictor of future use. Real systems sometimes blend these ideas or add aging to prevent old, frequently-used-but-no-long-used data from crowding the cache. The correct choice reflects these points: LRU evicts least recently used; LFU evicts least frequently used; LRU is good for temporal locality; LFU for stable access patterns. The other statements mischaracterize how the policies work or overgeneralize their applicability.

The main idea here is how eviction decisions use recency versus frequency to decide what to throw away. LRU (least recently used) evicts the item that hasn’t been used for the longest time. The logic is that if something was accessed recently, it’s likely to be accessed again soon because workloads often show temporal locality—recently used items tend to come back into use.

LFU (least frequently used) evicts the item with the lowest access count. The idea is that items that have been accessed often are likely to be accessed again, so keeping those “hot” items around is beneficial when the workload has stable, long-term popularity.

Thus, LRU shines when the workload exhibits temporal locality and patterns change over time; it adapts to recent behavior. LFU shines when there are a few consistently popular items and access patterns are stable enough that frequency is a good predictor of future use. Real systems sometimes blend these ideas or add aging to prevent old, frequently-used-but-no-long-used data from crowding the cache.

The correct choice reflects these points: LRU evicts least recently used; LFU evicts least frequently used; LRU is good for temporal locality; LFU for stable access patterns. The other statements mischaracterize how the policies work or overgeneralize their applicability.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy