Maintain the Median of a Number Stream

Read the full interview experience this question came from →

Quick Overview

Implement a stream data structure that supports integer insertions and exact median queries across up to 200,000 operations. Preserve duplicates and negatives, and return the arithmetic mean of the two middle values for even-sized streams.

Maintain the Median of a Number Stream

Company: ByteDance

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Overview: Implement a stream data structure that supports integer insertions and exact median queries across up to 200,000 operations. Preserve duplicates and negatives, and return the arithmetic mean of the two middle values for even-sized streams.

Read the full ByteDance Software Engineer interview experience this question came from

|Home/Coding & Algorithms/ByteDance
ByteDance logo
ByteDance
May 22, 2026
mediumSoftware EngineerOnsiteCoding & Algorithms
0
0
Loading...

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...