LinkedIn logoLinkedIn
Coding·55 minMembers

Cache with Rank-Based Eviction Policy

Members only

Given an interface where every cached value implements `rank()`, build a cache whose eviction policy drops the lowest-`rank()` entry on overflow. Hashmap plus a min-heap on `rank` is the baseline; the...

SWE
data-structure
hashmap
heap
object-design
medium
Frequency
Single report
Last asked
2026-01-22
Stage
phone-screen

Log in to continue reading the full content