23/37
Part 5 of 6 · Both limitsLearn and do

Capacity and time limits in one class: a new key in a full cache sweeps first, then evicts

Recency and expiry are two different orders over the same entries

Now give the time-limited cache a capacity too. The entries then carry two orders at once:

Predict

At time 10 the cache holds c, a, b, oldest use first. They expire at 50, 90 and 11. A new key needs room, and nothing has expired. Which key goes?

Pick an answer above to see the rest