TikTok
0-day streakReview

Your progress

Level 1

0 XP100 XP to level 2
0day streak
0best streak
0topics started
0cards reviewed
    Review cards

    Progress is stored only in this browser. No account is required.

    Design TikTok: the 60-second story

    Design TikTok

    Swipe, and the next video is already playing, picked from a billion.

    A recommender, not your follows, chose it in 150 ms. Your skip just taught it what to send next.

    55M/s

    model predictions to rank 500 videos per request

    Assume 500M daily users watching 150 videos each: 75B views, 110k feed requests a second. So cheap stages must shrink the pile first.

    Who decides your feed?

    Bad: Who you follow

    Fan-out dominates, like Instagram or Twitter.

    Good: A recommender

    Follows are one signal. A creator with 12 followers can reach millions if the video holds attention.

    2,000 candidates, 8 slots, about 140 ms

    Each stage spends more per candidate on fewer candidates. Cheap sources and a small pre-ranker protect the heavy multi-task model.

    You skip a cooking video after a second. Last night’s model can’t know your interest moved.

    The trick

    Learn at three speeds. Live features change your next batch in seconds; touched embeddings sync every minute.

    21 Tbps

    of video leaving the CDN, on average

    A first frame needs under 100 ms; a 4G fetch takes 150–300 ms. Prefetch only the first 1.5 s of the next three. Full downloads waste egress.

    13,500 videos in 90 days. Never show one twice.

    A 16 KB Bloom filter per user. Any 0 bit proves a video is new; all bits set drops it, about 1% wrongly.

    A new video earns its audience

    1. Embed it from frames, sound and caption
    2. Show it to ≈ 200 viewers whose interests match
    3. Compare completion, rewatches and shares with similar videos
    4. Pass the gate: ≈ 2,000 viewers, then ≈ 20,000

    Remember

    A recommender with a player attached. Funnel 2,000 candidates to 8 in 150 ms, learn from every swipe within minutes, test new videos on small pools, prefetch only the first 1.5 s.