Streaming Top-K Frequent Elements with O(1) Updates Instead of a Heap

Quick 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.

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.

NVIDIA logo
NVIDIA
Sep 15, 2026
mediumSoftware EngineerOnsiteSoftware Engineering Fundamentals
11
0
Loading...