Throughput: Assume YouTube-scale (we always design for millions of users). Let's do the math:
What counts as a view - they clicked on the video or they watched until the end?
Define the APIs expected from the system. This is your chance to analyze and define the read and write paths so that you can come up with the high-level design...
POST v1/views/{view_id} --> Write that a viewer viewed a video - takes in a user id, video id
PUT v1/views/{view_id} --> updates the existing view, how long of the video did they watch
GET v1/views/ --> takes in a user id, based on whether they are creator or viewer, it returns the correct counts for views. a creator will see more details than a viewer.
GET v1/views/analytics --> return a summary of views
Describe the overall system architecture. Identify the main components needed to solve the problem end-to-end. Use the diagramming tool to create a block diagram.
client(YouTube UI) --> view-service --> filter-fraud-service --> display-service
view-service receives the views - it ties the views to a user, it determines if it is a creator/viewer,
.
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.