Streaming Top-K Frequent Elements with O(1) Updates Instead of a Heap
Company: NVIDIA
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Onsite
Overview: Design a structure that consumes an unbounded stream and reports the K most frequent elements at any time, first with a heap and then with constant-time updates after the interviewer rejects the heap. It tests per-operation cost analysis, data-structure invariants, deterministic tie handling, and extensions to sliding windows, approximate counting, and sharded streams.