Design TikTok: the short-video feed system design interview walkthrough
The request to design TikTok trips candidates who treat it as "Instagram with videos." It is not. Instagram's feed is assembled from the accounts you follow; TikTok's For You feed is assembled from a recommendation system that mostly ignores who you follow and instead predicts what will hold your attention next. Add to that a video pipeline that has to ingest, transcode, and serve short clips so the next one plays the instant you swipe, and you have a system whose two hardest parts — recommendation and video delivery — barely appear in a normal social-feed design. This is why TikTok system design is its own prompt and not a reskin of the news feed.
The round turns on three decisions. First, the video pipeline: how a clip is uploaded without routing bytes through your servers, transcoded into multiple bitrates, and served from the edge. Second, the For You feed: how you generate candidate videos and rank them for one user when there is no follow graph to fan out. Third, the serving path that makes playback feel instant — prefetching the next few videos before the user swipes. This walkthrough follows the path a strong candidate draws in a system design interview — requirements, estimate, API and data model, high-level design, then the deep dives — and at each step it names the follow-up the interviewer uses to tell a memorised answer from an engineer who understands the tradeoff.
How the TikTok round is actually run
A short-video design round runs about 60 minutes on a shared canvas — you draw the boxes and arrows while you talk, and the interviewer interrupts. It is a favourite because the one-line problem hides two deep systems: the moment you say "the user uploads a video," the question becomes how is it transcoded and served so it plays instantly, and the moment you say "then they see a feed," the question becomes there is no follow graph — where do the videos come from. Get the pipeline and the recommendation spine clean and you have shown the whole loop in one problem.
The interviewer rarely lets "show them videos from people they follow" stand. "The For You feed has no follow graph to fan out — walk me through exactly how you pick the next video for one user." That question — recommendation as candidate generation plus ranking — is the one a copied answer can never rehearse, and the one this round is really testing.
The rounds here are modelled on how the loop runs, not scraped from any candidate's recall. What matters for prep is the shape: a blank canvas, a clock, and a follow-up after every decision you make.
The five-step framework for any HLD round
Every high-level design answer fits the same spine. Say it out loud at the start so the interviewer knows you have a plan, then walk it:
- Clarify requirements — functional and non-functional, and what you are explicitly not building.
- Estimate — users, uploads, views, and the storage and bandwidth footprint, to justify every later choice.
- High-level design — the boxes and arrows: client, upload, transcoding, CDN, feed/recommendation, stores.
- Deep dive — the two or three decisions that actually decide this system.
- Follow-ups — bottlenecks, failure modes, and what you would change at ten times the scale.
What the debrief measures
The score is not "right or wrong design." A good HLD debrief reads on four dimensions, and every move below maps to one: problem solving (did you keep video off the application path and then design a recommendation feed rather than a fanout), communication (did you say why the For You feed is candidate-generation-plus-ranking in a sentence), technical execution (transcoding to a bitrate ladder, CDN delivery, candidate generation, ranking, prefetch), and time management (did you spend your 60 minutes on the pipeline and recommendation, not the likes schema). Reading a walkthrough teaches the design; it does not teach you to deliver it on the clock while someone pushes back.
Step 1 — Requirements: what TikTok must do
Spend the first few minutes here. Jumping to boxes before you have scoped the problem is the fastest way to design the wrong system.
| Type | Requirement |
|---|---|
| Functional | Upload a short video with a caption; watch an endless For You feed of recommended videos; like, comment, share, and follow; record the watch signals (view, watch time, skip) that feed recommendations. |
| Functional (optional) | A Following feed, search, hashtags/sounds, duets, DMs — call these out, then scope most of them for later. |
| Non-functional | Durable video storage; instant playback (the next video starts the moment you swipe); fast delivery everywhere; read/view-heavy; highly available; eventual consistency is fine for recommendations and counts. |
The sentence that earns points: "The hard parts are not the social graph — they are the video pipeline (ingest, transcode, serve from the edge so playback is instant) and the For You feed, which is a recommendation system of candidate generation plus ranking, not a fanout of posts from people you follow." Say that and you have framed the entire design before drawing a box.
Step 2 — Capacity estimation (back of the envelope)
Estimation here proves two things: video storage and bandwidth dominate, and the feed is a ranking cost, not a fanout cost.
| Quantity | Assumption | Result |
|---|---|---|
| Daily active users | ~1B | — |
| Uploads | ~tens of millions of videos/day | large, but dwarfed by views |
| Views | hundreds of videos watched per user per day | an enormous read/stream volume |
| Average video | ~5–20 MB after transcoding, multiple bitrates | hundreds of TB/day of new media → petabytes, plus huge egress |
| Feed cost | one ranked list per user per session | a per-request ranking over candidates, not a per-post fanout |
The conclusion to say out loud: two numbers dominate. Video storage and especially delivery bandwidth are the biggest cost — the media cannot pass through your application servers and must be served from a CDN. And the feed is produced by ranking a candidate set per request, so there is no write-time fanout and no celebrity problem; the scaling challenge is the recommendation pipeline and the streaming egress. You have now pointed the interview at both deep dives — the pipeline and recommendation — before anyone asked.
Step 3 — API and data model
The API is small. An upload path, a feed path, and the interaction events that train recommendations:
| Endpoint | Operation |
|---|---|
POST /video/upload-url |
Request a pre-signed upload URL — the client uploads the raw video directly to the blob store. |
POST /video |
Create the video record after upload — createVideo(user_id, media_ref, caption, sound) returns a video_id. |
GET /feed/foryou |
Fetch the next page of recommended videos — getForYou(user_id, cursor) returns ranked video_ids + CDN URLs. |
POST /event |
Record a watch signal — logEvent(user_id, video_id, type, watch_ms) for view, like, skip, share. |
The data model splits across stores. The video metadata is small; the media bytes live once in a blob store; interaction events stream to the recommendation pipeline:
| Entity | Notes |
|---|---|
video |
video_id, author_id, caption, sound_id, media_ref (blob key), created_at, plus denormalised counters. |
media |
The transcoded renditions (a bitrate ladder) in the blob store, served through the CDN. |
event |
(user_id, video_id, type, watch_ms, ts) — the watch signals, streamed to the feature store and training. |
follow |
Optional, for the secondary Following feed — not used by For You. |
Step 4 — High-level design: upload path, feed path, and events
Now the boxes. The design splits into a media pipeline, a recommendation feed path, and an event stream that trains it:
- Client → API gateway: the entry point for all requests.
- Upload + transcoding (write path): the client gets a pre-signed URL and uploads the raw video directly to the blob store; a transcoding service picks it up off a queue and produces a bitrate ladder (several resolutions/bitrates) plus a thumbnail, writes them back, and marks the video ready.
- Blob store + CDN: the object store holds every rendition durably; a CDN serves video segments from edge locations close to the viewer.
-
For You service (read path): on
GET /feed/foryou, runs candidate generation (pull a few hundred plausible videos for this user) then ranking (score them with a model) and returns a page ofvideo_ids with CDN URLs. - Event pipeline: watch events stream through a log (e.g. Kafka) into a feature store and model training, closing the loop so recommendations improve.
- Metadata + counters store: the small video records and engagement counts.
Say explicitly that two things never touch your application tier at request time: the video bytes (client streams from the CDN) and the feed is not fanned out (it is computed per request by ranking candidates). Naming both unprompted is a signal the interviewer is listening for.
Deep dive: the video pipeline — transcoding and adaptive delivery
This is the decision that makes playback instant, and the one candidates skip by saying "store the video and serve it."
Upload: go direct, with a pre-signed URL. The client asks your API for permission and uploads the raw file straight to the blob store — your application servers never see the bytes. This keeps the API tier cheap and removes the upload-bandwidth bottleneck.
Transcode into a bitrate ladder. A phone uploads one raw clip in one resolution; playback needs several. A transcoding service generates a ladder of renditions — low, medium, high bitrate — split into small segments, plus a thumbnail. This is done asynchronously off a queue, which keeps upload latency low and lets you re-encode into new formats later.
Deliver with adaptive bitrate from a CDN. Video segments are immutable, which makes them ideal for edge caching. Serve them through a CDN using adaptive bitrate streaming: the player picks the rendition that matches the viewer's current bandwidth and switches on the fly, so a video starts fast and does not stall. The database returns only the manifest/URLs; the heavy segments travel client ↔ CDN.
"A user on a weak connection opens a video — how does it start fast and not buffer?" The player requests an adaptive bitrate stream from the CDN and starts on a low rendition, stepping up as bandwidth allows; segments are cached at the edge, and the bytes never pass through your API servers.
System Design
HLD · Short-Video Feed · 60 min
Design TikTok out loud, with follow-ups
Deep dive: the For You feed — candidate generation and ranking
This is the decision that separates TikTok from every follow-graph feed, and the one the interviewer is really probing. There is no fanout; the feed is recommended.
Why not fanout. The For You feed is not "posts from people you follow," so there is nothing to push into a per-user timeline on write. Instead, for each request you build a feed on the fly from the whole catalogue, personalised to the user. That turns the problem from a write-time fanout into a read-time recommendation problem, which has two stages.
Stage 1 — candidate generation. Narrow billions of videos down to a few hundred plausible ones for this user, cheaply. This blends several sources: videos similar to ones the user watched (embedding/ANN lookup), trending and fresh videos, videos popular with similar users, and a slice of exploration so the feed does not collapse to the same themes. The output is a candidate pool, not a final order.
Stage 2 — ranking. Score each candidate with a model that predicts engagement — probability of watching to completion, liking, sharing — using features about the user, the video, and their interaction history from the feature store. Order the page by that score, apply diversity and freshness rules so the feed is not repetitive, and return it.
The feedback loop. Every watch event — especially watch time and skips — streams back through the event pipeline into the feature store and model training. That loop is why the feed gets better the more you scroll, and saying it out loud is the senior framing: the For You feed is a recommendation system with a closed training loop, not a query over a social graph.
"There's no follow graph — how do you pick the next video for one user?" Candidate generation narrows billions of videos to a few hundred (similar-content, trending, similar-users, exploration), then a ranking model scores them on predicted watch time and engagement using features from a feature store; the page is the top-ranked, diversified slice.
System Design
HLD · Recommendation feed · 60 min
Defend candidate generation and ranking out loud
Deep dive: the serving path — prefetch and instant playback
This is the decision that makes the swipe feel instant. A recommendation feed is only as good as its latency between videos.
Prefetch the next few. When the For You service returns a page, it returns several videos, not one. The client prefetches the next one or two videos' first segments from the CDN while the current one plays, so a swipe starts playback immediately from already-buffered bytes. This is the single most important trick for the "instant next video" feel.
Keep ranking off the critical path. Candidate generation and ranking run ahead of the swipe — a page is computed and buffered before the user reaches the end of it — so the model's latency never shows up as a stall. Counters (views, likes) are updated asynchronously and can be eventually consistent; nothing on the hot path waits on them.
"I swipe and the next video plays with no delay — how?" The feed page already contained several ranked videos, and the client prefetched the next ones' opening segments from the CDN while you watched the current one, so the swipe plays from buffered bytes — ranking happened ahead of time, off the critical path.
The follow-ups that decide the TikTok round
Scan the probes from each deep dive and they rhyme. Master these five and you are ready for a version of the question that is not drawn exactly like this one.
- "Where do the uploaded bytes go, and how is the video served?" → Direct to the blob store via a pre-signed URL; transcoded into a bitrate ladder; served adaptively from a CDN. (technical execution)
- "There's no follow graph — how is the For You feed built?" → Candidate generation narrows the catalogue, a ranking model scores on predicted watch time, the page is the diversified top slice. (problem solving)
- "Why not fan out like a news feed?" → There is nothing to fan out — the feed is recommended per request, not pushed from followed accounts. (communication)
- "Why does the next video play instantly?" → The page returns several videos and the client prefetches the next ones' segments from the CDN while the current one plays. (technical execution)
- "How does the feed improve as I scroll?" → Watch events, especially watch time and skips, stream back into the feature store and model training — a closed loop. (problem solving)
Each maps to a debrief dimension. Reading this list teaches you the answers; it does not teach you to deliver them while someone interrupts — that only comes from saying them out loud.
How to prepare: a one-week plan
You do not need fifty systems. You need this one cold and the framework automatic, so the next "design X" is just new nouns in the same five steps.
- Days 1–2: Learn the five-step framework until it is reflex. Do TikTok end to end on paper — requirements, estimate, API, data model, the pipeline and the feed as two sets of boxes.
- Days 3–4: Drill the video pipeline: pre-signed direct upload, transcoding into a bitrate ladder, adaptive CDN delivery. Say each tradeoff in one sentence.
- Days 5–6: Own the recommendation feed and serving path — candidate generation, ranking, the feedback loop, prefetch for instant playback. Answer each of the five follow-ups out loud.
- Day 7: A full timed 60-minute round, narrating the whole way, with someone (or something) interrupting. This is the rep that counts.
This post is the deep walkthrough behind one row of the broader Top 25 system design interview questions — once TikTok is automatic, the same spine carries the rest of the list.
Frequently asked questions
How do I design TikTok step by step?
Follow the five-step HLD framework. Clarify requirements (upload a short video, watch an endless For You feed, interact, record watch signals; durable video, instant playback, view-heavy, eventual consistency is fine); estimate to show video storage and delivery bandwidth dominate and the feed is a ranking cost, not a fanout cost; define POST /video/upload-url, POST /video, GET /feed/foryou, and POST /event; draw three parts — a media pipeline (pre-signed upload → transcoding into a bitrate ladder → CDN), a For You read path (candidate generation → ranking), and an event stream that trains the model; then deep-dive the pipeline, the recommendation feed, and the prefetch serving path. Finish on the follow-ups about latency and scale.
How is designing TikTok different from designing Instagram or a news feed?
A news feed and Instagram assemble the feed from accounts you follow, so the hard problem is fanout and the celebrity case. TikTok's For You feed has no follow graph — it is a recommendation system, so there is no fanout and no celebrity problem. Instead the feed is built per request by candidate generation (narrowing the catalogue to a few hundred videos) and ranking (scoring them on predicted engagement). TikTok also leans harder on the video pipeline — transcoding into adaptive bitrates and serving from a CDN — because it is short-video, not photo, first.
How does the For You recommendation feed work?
In two stages. Candidate generation cheaply narrows billions of videos to a few hundred plausible ones for the user, blending similar-content (embedding lookups), trending and fresh videos, videos popular with similar users, and some exploration. A ranking model then scores each candidate on predicted watch time and engagement using features about the user, the video, and their history from a feature store, and the page is the top-ranked, diversified slice. Watch events stream back into training, so the feed improves as the user scrolls — a closed recommendation loop, not a query over a social graph.
How are videos stored and delivered in TikTok's design?
Raw uploads go directly to a blob store via a pre-signed URL, never through your application servers. A transcoding service then produces a bitrate ladder — several resolutions split into small segments — plus a thumbnail, stored once in the blob store. Because segments are immutable, they are served through a CDN using adaptive bitrate streaming: the player picks the rendition that fits the viewer's bandwidth and switches on the fly. The database holds only the manifest and references, so the heavy bytes travel between the client and the CDN edge.
Why does the next TikTok video play instantly?
Because the work happened before you swiped. The For You page returns several ranked videos at once, and the client prefetches the opening segments of the next one or two from the CDN while the current video plays. A swipe then starts from already-buffered bytes, so there is no wait. Ranking and candidate generation run ahead of the critical path, and counters update asynchronously, so neither the model nor the database ever makes playback stall.
How do I practise a system design interview out loud?
Reading a walkthrough is not the same as defending a design while someone interrupts. On Zynter, the HLD track runs live voice rounds modelled on how real system design loops run — you talk through a shared design on the canvas, and a voice interviewer pushes with the follow-ups above one at a time, then gives you a debrief on problem solving, communication, technical execution, and time management. The score is a practice signal, not a hiring decision.
Practise it on Zynter
You can read every tradeoff. The round is won on the recommendation feed and the pipeline.
Pick the short-video feed round, draw the pipeline and the For You path on the canvas, and defend them out loud to a voice interviewer that keeps asking "where do the bytes go?" and "there's no follow graph — how do you pick the next video?" — then read the debrief. Zynter.ai is on-demand mock interviews modelled on real company loops, with 150+ rounds across 20 companies including the HLD system design track (Sep 2026).
Practise the short-video feed round →
Browse all interview tracks




Top comments (0)