Back to Questions

Design a Least Frequently Used (LFU) Cache

104K viewsAsked at Google
Hard

Question Explain

Design and implement a Least Frequently Used (LFU) cache. It should support `get` and `put` operations in $O(1)$ average time. This is one of the most complex $O(1)$ cache problems.

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question
Design a Least Frequently Used (LFU) Cache - Interview Question