October 2025
Intermediate to advanced
485 pages
13h 2m
English
These are the solutions to the Exercises.
In the first five steps, we fill up our cache with 5 values:
| | ["c", "t", "h", "o", "p"] |
Technically, these are all cache misses, so we have 5 cache misses so far. When we then request the next "t" and "h", these are both cache hits since those values are currently in the cache.
Next, we reach the first "z", which brings our cache miss tally to 6. This will evict the "c" since the "c" will never be requested again. Our cache currently looks like this:
| | ["z", "t", "h", "o", "p"] |
The next request is the second "o", which is a cache hit. After that, we reach the "a", which is our 7th cache miss. This will evict the "o", which won’t ever be requested again.
Our cache now looks like this:
| | ["z", ... |
Read now
Unlock full access