Back to Questions

Design a Data Stream Median Finder

60.4K viewsAsked at Microsoft
Hard

Question Explain

Design a data structure that supports adding integers from a data stream and finding the median of all elements added so far. Use two heaps (Max-Heap for the lower half, Min-Heap for the upper half).

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question