Smallest Bandwidth That Streams a Title With No Rebuffering
Last updated: November 29, 2026
Quick Overview
A title is split into segments of known size (kilobits) that each play for a fixed duration after a startup delay, and the player buffer holds at most C segments. Downloads are sequential at a constant bandwidth, and a segment may only start downloading when a buffer slot is free. Find the smallest integer bandwidth in kbps that never rebuffers.
Netflix
November 29, 20260
0
0 solved
A title is split into segments of known size (kilobits) that each play for a fixed duration after a startup delay, and the player buffer holds at most C segments. Downloads are sequential at a constant bandwidth, and a segment may only start downloading when a buffer slot is free. Find the smallest integer bandwidth in kbps that never rebuffers.
Netflix encodes titles per shot and per segment, so segment sizes vary a lot and a single action scene can dominate bandwidth needs. This question tests binary search on the answer: the candidate has to write a correct feasibility simulation, argue it is monotonic in bandwidth, and keep the arithmetic exact.
What the Interviewer Expects
- Write a feasibility check that simulates downloads against playback deadlines
- Model the buffer cap as an earliest start time for each download
- Argue monotonicity: more bandwidth never makes a feasible plan infeasible
- Binary search the integer answer with a doubling upper bound
- Use exact arithmetic or careful units to avoid float boundary errors
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would the answer change if segments could be fetched over two parallel connections?
- How would you find the minimum startup delay for a given bandwidth instead?
- What if bandwidth varies over time as a known schedule?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Segment i plays during [startup + i*seg, startup + (i+1)seg). It must be fully downloaded by startup + iseg. Downloads happen one at a time. Because the buffer holds C segments, segment i (for i >= ...
High-Level Design
Feasibility at bandwidth B is a greedy simulation: start each download as early as allowed (after the previous download and after a buffer slot opens) and check its finish against its deadline. Starti...