Code Room
System designMedium
Question
Design the animated-preview / short-loop generation pipeline for a short-video feed where, as a user scrolls, each video tile plays a tiny silent looping preview (a few seconds, low-res, autoplaying) before they tap in — generated for every uploaded video so the feed feels alive. You must pick the most engaging few-second segment of each video, produce a tiny fast-loading looping asset (animated WebP/short MP4) at feed scale (hundreds of millions of videos), and serve it cheaply since most previews are never even watched to completion.
What a strong answer looks like
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.
Learn the concepts
Loading whiteboard…
Run or narrate your approach, then ask the coach.