October 2025
Intermediate to advanced
485 pages
13h 2m
English
The following exercises provide you with the opportunity to practice with caching. The solutions to these exercises are found in the section Chapter 4.
Say that we have a cache that holds up to 5 values. How many cache misses occur for this sequence if our cache uses the clairvoyant eviction policy?
| | "c", "t", "h", "o", "p", "t", "h", "z", "o", "a", "p", "t", "b", "z", "h" |
How many cache misses will occur if our cache uses the LRU eviction policy for the prior sequence?
Following is a Python class representing a rather contrived concept that I call a “Bit Box”:
| | class BitBox: |
| | def __init__(self): |
| | self.red_bits = [1] * 10000 |
| | self.blue_bits = [1] * 10000 |
| | self.green_bits = [1] * 10000 |
Basically, each Bit Box is a storage ...
Read now
Unlock full access