TikTok System Design
In this lesson1 sections
TikTok System Design
Practice: a short-video feed
Design a hypothetical short-video application in which a viewer swipes to request the next recommended clip. Creators upload videos, and the service prepares playable renditions before recommending them. Reuse the video pipeline from this chapter, then explain what changes when viewers skip quickly between clips.
Start with two separate paths: upload-to-publication and feed-to-playback. Define when a video becomes eligible for recommendation, where its source and renditions live, and how a failed transcode is retried. A feed item must not reference a rendition that is still incomplete.
For the viewing path, explain candidate generation, ranking, access filtering, and media delivery. Decide whether the client prefetches the next clip. Prefetch can reduce startup delay, but skipped clips waste bandwidth and cache capacity. State a hypothetical prefetch policy and the measurements that would justify changing it.
Then examine the feedback loop. The client sends view, skip, and reaction events. Define each event precisely, give retried events stable identities, and separate immediate serving features from later analytics. A delivery acknowledgment is not evidence that the viewer watched the entire clip.
Test the design with these cases:
The rest of this lesson is for Premium members
Premium opens every lesson in this course, along with all questions and solutions on PracHub.