Concept Flow - LRU cache design with hash map and doubly linked list
Start: Cache empty
Insert new key
Is cache full?
No→Add node at head of DLL
Add key-node to hashmap
Remove tail node
Add new node at head
Update hashmap with new node
Access key?
Yes
Move node to head
Return value
End
The cache stores keys in a doubly linked list (DLL) for order and a hashmap for fast access. On insert, if full, remove tail node (least recently used). On access, move node to head (most recently used).