The Question
CodingDesign an LRU Cache
Design and implement a data structure for a Least Recently Used (LRU) Cache. It should support 'get' and 'put' operations in O(1) time complexity. When the cache reaches its capacity, it should invalidate the least recently used item before inserting a new item.
Java
HashMap
Doubly Linked List
LRU Cache
March 13, 2026