PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Coding & Algorithms/Uber

Design top-K tracker with linked lists

Last updated: Mar 29, 2026

Quick Overview

This question evaluates data structure design and algorithmic analysis skills, focusing on frequency tracking, tie-breaking and deletion semantics, and reasoning about time and memory complexity.

  • Medium
  • Uber
  • Coding & Algorithms
  • Software Engineer

Design top-K tracker with linked lists

Company: Uber

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

Design a data structure that tracks the top-K most frequent keys in a stream. Support operations increment(key), decrement(key), and topK(k) -> list of k keys with highest frequencies. Achieve O( 1) amortized updates by combining a hash map with a doubly linked list of frequency buckets. Specify tie-breaking, deletion behavior when counts drop to zero, memory usage, and complexity.

Quick Answer: This question evaluates data structure design and algorithmic analysis skills, focusing on frequency tracking, tie-breaking and deletion semantics, and reasoning about time and memory complexity.

Related Interview Questions

  • Implement stream queries and bounded-difference subarrays - Uber (medium)
  • Implement Minesweeper and Word Search - Uber (medium)
  • Implement Store Autocomplete - Uber (medium)
  • Simulate a Rank-Based Tournament - Uber (medium)
  • Implement Cache Eviction And Seat Assignment - Uber (medium)
Uber logo
Uber
Aug 1, 2025, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
6
0

Design a data structure that tracks the top-K most frequent keys in a stream. Support operations increment(key), decrement(key), and topK(k) -> list of k keys with highest frequencies. Achieve O(

  1. amortized updates by combining a hash map with a doubly linked list of frequency buckets. Specify tie-breaking, deletion behavior when counts drop to zero, memory usage, and complexity.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Uber•More Software Engineer•Uber Software Engineer•Uber 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.