This question evaluates a candidate's proficiency in stream-processing algorithms and scalable data structures for frequency estimation and top-K queries, emphasizing analysis of time/space trade-offs, sliding-window semantics, and distributed aggregation.

Given a high-volume stream of events (e.g., account IDs from new account openings), design and implement a data structure that supports: (