Question bank › Math
Dsa Math Medium

Find the Median of a Stream

You are tasked with maintaining a running median for a stream of numbers. Implement the function to process a series of numbers and print the median after each number is added to the stream. Input consists of multiple lines where each line contains a single integer. After processing all inputs, print the running median results formatted to two decimal places. Example Input: 5 15 1 3 8 Example Output: 5.00 10.00 5.00 4.00 5.00

Key concepts

medianstreamingstatistics

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.