Question library
Questions from real interviews. Drill any of them by voice in a couple of minutes, with an interviewer, a score and feedback.
Implement a fixed-capacity LRU cache. The get method takes a key and returns the value or an indication that it's missing, the put method adds or updates a value, and on overflow the key that has gone unused the longest is evicted. Both operations must run in O(1).Mid-levelImplement an LRUCache class with a given capacity and two methods: get returns the value for a key or None, and put stores a value. When the cache overflows, the key that hasn't been accessed for the longest time is evicted, and both operations must run in O(1).Mid-levelImplement an LruCache class with a fixed capacity passed to the constructor. The get method returns the value for a key or null, the put method stores a key-value pair, and when the cache overflows, the element that hasn't been accessed for the longest time is evicted. Both operations must run in constant time.Mid-level