This question evaluates understanding of streaming data structures, median maintenance, and algorithmic complexity in the Coding & Algorithms domain by requiring efficient insertions (O(log n)) and constant-time median queries (O(1)).
Senior problem-solving round assessing algorithmic thinking under time pressure.
Design a data structure that supports inserting integers from an endless stream and returning the median in O(log n) per insertion and O(
Two heaps approach; keep sizes balanced; median at roots.