Object-Oriented Programming · Confluent · Hard
This problem is a variant of the classic LRU Cache problem; working through that problem first may be helpful. Design a data structure that receives key-value pairs with timestamps and can answer queries about the pairs that fall inside a given time window. For all operations, the smallest unit of time is one minute. Implement the WindowedKeyValueStore class: WindowedKeyValueStore(int capacity, int windowSize) — initializes the store with positive capacity and windowSize.…
Checking your access…