PHONEPE SDE1 | Real-Time Statistical Computation Using Heap-Based Data Structures | OA(2024)

PhonePe · Question · Posted Jun 2026

Q1. Dynamic Median Tracking in a Continuous Number Stream Problem Statement Design a data structure that supports the following operations efficiently: Operations addNum(int num) Adds a number into the data stream. findMedian() Returns the median of all numbers added so far. Median Definition If the total number of elements is odd, the median is the middle element. If the total number of elements is even, the median is the average of the two middle elements. The data structure should support ...

The full answer & interview discussion are available to premium members.

Log in Create a free account