Back to problems

Weighted LRU Cache

Object-Oriented Programming · xAI · Medium

Weighted LRU Cache Coding Software Engineer High Frequency Problem Overview Create a weighted Least Recently Used (LRU) cache in which every stored entry has an associated size, or weight. In contrast to an ordinary LRU cache, where every entry consumes one unit of capacity, this cache measures usage by adding the sizes of all entries. This design is useful when cached values do not all occupy the same amount of space, for example: Images with different resolutions may have…

Checking your access…