PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Coding & Algorithms/Intuit

Implement LRU, Extend to LFU, Analyze Complexity

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of cache eviction policies (LRU and LFU), frequency tracking, and the design of data structures that support efficient get/put operations while meeting time and space complexity constraints.

  • Medium
  • Intuit
  • Coding & Algorithms
  • Software Engineer

Implement LRU, Extend to LFU, Analyze Complexity

Company: Intuit

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Implement an in-memory Least Recently Used (LRU) cache with capacity N that supports get(key) -> value and put(key, value). Achieve O( 1) average time per operation using appropriate data structures; justify your choices and analyze time and space complexity. Follow-up: Modify the design to implement a Least Frequently Used (LFU) cache with O( 1) or amortized O( 1) operations; explain the eviction policy, how you track and update frequencies on get/put, and how you break ties by recency.

Quick Answer: This question evaluates understanding of cache eviction policies (LRU and LFU), frequency tracking, and the design of data structures that support efficient get/put operations while meeting time and space complexity constraints.

Related Interview Questions

  • Validate bracket sequence - Intuit (easy)
  • Find Business Degrees of Separation - Intuit (hard)
  • Produce valid student lineup from parent array - Intuit (medium)
  • Find largest filename from ls -l output - Intuit (medium)
  • Sum palindrome-change costs over all substrings - Intuit (medium)
Intuit logo
Intuit
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
2
0

Implement an in-memory Least Recently Used (LRU) cache with capacity N that supports get(key) -> value and put(key, value). Achieve O(

  1. average time per operation using appropriate data structures; justify your choices and analyze time and space complexity. Follow-up: Modify the design to implement a Least Frequently Used (LFU) cache with O(
  2. or amortized O(
  3. operations; explain the eviction policy, how you track and update frequencies on get/put, and how you break ties by recency.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Intuit•More Software Engineer•Intuit Software Engineer•Intuit Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.