AI Interview Prep is optimized for larger screens
Please open this on a laptop or desktop (1024px and wider) to use the full editor, whiteboard, and AI coaching surface.
Understand the problem
Restate the problem precisely. Interviewers reward candidates who pause, define the contract, and name the guarantees before coding.
The median is the middle value in an ordered integer list. If the size of the list is even, the median is the mean of the two middle values. Implement the `MedianFinder` class: - `MedianFinder()` — initializes the object. - `void addNum(int num)` — adds the integer `num` from the data stream to the data structure. - `double findMedian()` — returns the median of all elements so far. Answers within 10⁻⁵ of the true value will be accepted.
Once you've drafted a response, click Submit for AI review and a senior engineer will critique your reasoning.