This is a Hard problem asked by Google, Meta, Amazon, Microsoft, and LinkedIn. It's one of the most common Hard problems in interviews. The two-heaps pattern is effective. It applies to sliding window median, finding the median of a sliding window, and real-time percentile calculations. Interviewers may ask: "What if we want the th percentile?" or "What if there are many duplicates?" These test whether you understand the pattern deeply.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/maang-interview-prep/heaps-priority-queues/find-median-from-data-stream-why-this-problem
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████