Design a data structure that returns the top K most frequent numbers from a stream.
Unlock detailed company stats for this questionUpgrade
Design a data structure that supports a continuous stream of numbers with these operations: add a number to the list, and query the current Top K most frequent numbers. Operations can come in any order and must work efficiently for an infinite stream.
Format · Technical interview.
Community answers
No answers contributed by the community yet.
Related questions
Design a data structure that supports adding numbers from a stream and finding their median.Return the Top K most frequent error codes from a list of log lines.Find Median from Data Stream: design a data structure supporting addNum(num) and findMedian().Related courses

Course

Course
Course
