Peak Concurrent Yahoo Sports Live Streams From Broadcast Windows

Last updated: November 29, 2026

Quick Overview

You are given the scheduled start and end times of live game streams on Yahoo Sports as half-open intervals [start, end). Return the maximum number of streams running at the same time and the earliest moment that peak begins.

Yahoo
Coding & Algorithms
Software Engineer
Yahoo
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Medium

0

0

0 solved


You are given the scheduled start and end times of live game streams on Yahoo Sports as half-open intervals [start, end). Return the maximum number of streams running at the same time and the earliest moment that peak begins.

Yahoo Sports streams live games and needs to provision encoders and CDN capacity for the busiest moment of a schedule. Interviewers use this to test sweep-line reasoning and careful tie-breaking at shared boundaries.

What the Interviewer Expects
  • Convert intervals into +1 and -1 events
  • Sort events by time with ends before starts at the same timestamp
  • Track the running count and record when it first hits a new maximum
  • Discuss O(n log n) time and alternatives like a min-heap of end times
  • Reject or ignore empty intervals where start >= end
Key Topics to Cover
sweep line
intervals
sorting
event processing
capacity planning
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you return all time ranges where the peak holds, not just the start?
  • If each stream has a bitrate, how do you find peak bandwidth instead of count?
  • How would you handle a schedule of 10 million streams that does not fit in memory?
  • How would you answer 'how many streams are live at time t' for many queries?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Input: list of (start, end) with half-open semantics, so a stream ending at 10 and one starting at 10 do not overlap. Output: (peak, time) where time is the earliest instant that the count reach...

High-Level Design

Emit (start, +1) and (end, -1) for each stream. Sort by time, and at equal times process -1 first, which encodes half-open intervals. Sweep with a running counter and remember the first time it ...


Submit Your Answer
Markdown supported