Loading...
Loading...
Staff · 50 min
Also asked as: Netflix, YouTube, Twitch, Disney+, Vimeo.
Read it once, then start the timer and work without scrolling.
Design a video streaming player with adaptive bitrate that plays back long-form content across desktop, mobile web, and living-room browsers.
Everything below is a model answer. You will get far more out of this drill by attempting it cold first — set the timer, talk through it out loud, and only then compare.
A 50-minute phase plan you can practise against a clock.
Interactive · Drill rehearsal timer
6:00
Time remaining in Clarify and scope.
What you should establish before drawing a single box.
Architecture, data, interfaces, and optimisations — the RADIO body.
The half of the answer most candidates skip entirely.
Naming how the system breaks, and what the user sees when it does, is the cheapest way to signal production experience. Work through these before the interviewer has to ask.
The interviewer will challenge you. Rehearse the concession, not just the defence.
Interviewer
Why write your own ABR at all? hls.js and dash.js already ship one, and Safari's native player does it for free.
Model response
That is largely right and I would start on hls.js rather than writing a demuxer. The part I would not delegate is the ABR policy, and only after we have QoE data showing the default is costing us. Library defaults are tuned for a general audience; if our traffic skews toward mobile networks in one region, the default step-up aggressiveness may be producing rebuffers that show up directly in retention. The honest framing is: adopt the library, keep the ABR controller behind an interface, and only replace the policy when we can prove a win on rebuffer ratio. If the data shows the default is fine, writing our own is pure liability — someone has to own it at 2am.
Interviewer
Buffer-based ABR sounds nice in theory but it reacts slowly. On a mobile connection that drops from LTE to 3G, your buffer stays high for twenty seconds while you are already failing.
Model response
You are right that pure buffer-based ABR is blind during that window, and that is exactly the scenario where it underperforms. That is why I proposed hybrid rather than pure buffer-based: throughput samples are still measured continuously, and an abrupt drop in measured throughput triggers a downshift even when the buffer looks healthy. The concrete mechanism is the in-flight abort — if the current segment's projected completion exceeds the remaining buffer, we abort and re-request lower. Buffer occupancy is the steady-state signal; throughput is the transient signal. If our audience were overwhelmingly on stable fixed broadband I would weight buffer far more heavily and accept slower reaction, because the false-downshift cost would dominate.
Interviewer
You are proposing a multi-CDN setup. That doubles the integration cost and the contract complexity for an availability problem that may never happen.
Model response
The cost is real and for a v1 with modest traffic I would ship single-CDN and say so explicitly. What I would not do is bake the CDN host into segment URLs in a way that makes failover a code change. The cheap version of this is a manifest that carries a host list and a player that can rewrite the host on repeated failures — that is maybe a day of work and it converts a multi-hour incident into a config change. The expensive version, with real-time traffic steering and per-region scoring, only pays for itself once a CDN brownout costs more than the engineering. I would put the seam in early and the second vendor in later, and I would tie that decision to a concrete availability number rather than to fear.
Interviewer
Your startup optimization uses a persisted bandwidth estimate. If the user moved from office wifi to a train, you will start at a rung they cannot sustain and rebuffer in the first five seconds — the worst possible moment.
Model response
That is the exact failure mode and it is why I would gate the hint rather than trust it. Two guards: cap the hinted start at one or two rungs below the persisted estimate so we are biased pessimistic, and discard the hint entirely once the first real throughput sample lands, which is within a second or so. I would also key the persisted estimate on a coarse network signature from the Network Information API where available, so a connection-type change invalidates it. And I would measure it — if the startup-rebuffer rate for hinted sessions is worse than for cold sessions, the hint is a net negative and we turn it off with a flag. It is an optimization I would ship behind an experiment, not a default I would assume is correct.
Specific signals an interviewer is listening for on this prompt.
Turn one attempt into retained skill.