Loading interview...
The Frequency Eviction
A hard Python mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- Python
- Difficulty
- hard
- Seniority
- senior, staff
Interview Prompt
A content delivery system needs a cache that evicts the least frequently accessed item when full. Items accessed the same number of times should be evicted in least-recently-used order. Implement an LFU cache with get and put operations, both in O(1) amortized time.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write your python solution with real code execution
- Get instant feedback and a hire/no-hire decision