Interview Guides

Design an LRU (Least Recently Used) cache with a fixed positive capacity. Implement a class that supports get(key) and put(key, value) in O(1) average time. get returns the value for key if present, otherwise -1. put inserts or updates the key; if the cache exceeds capacity, evict the least recently used key.