Object-Oriented Programming · Netflix · Hard
Problem Design a weighted cache that stores key-value pairs along with a positive integer weight. The cache is constrained by a maxTotalWeight capacity. It must ensure that the sum of the weights held at any time never exceeds this limit. When an insert or update would push the total weight past the capacity: The cache evicts items with the greatest weight first. In the event of a weight tie, any of the tied items may be chosen for eviction. Implement the WeightedCache…
Checking your access…