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

  1. Read the vague prompt (just like a real interview)
  2. Ask clarifying questions to the AI interviewer
  3. Write your python solution with real code execution
  4. Get instant feedback and a hire/no-hire decision