Which of the following diagrams best represents a scalable high-level architecture for a video recommendation system that handles millions of users and videos?
Think about the order of components to optimize latency and scalability.
The load balancer should distribute incoming user requests before hitting the recommendation service. Cache should be checked before querying the video metadata database to reduce latency for repeated queries.
A video recommendation system expects 10 million daily active users, each making 20 recommendation requests per day. Each request requires 200ms of CPU time on the recommendation service. How many recommendation service instances are needed to handle peak load assuming 10% of daily requests happen in the busiest hour and each instance can handle 50 requests per second?
Calculate total requests in peak hour, then divide by requests per instance per second and seconds in an hour.
Daily requests = 10M * 20 = 200M. Peak hour requests = 10% * 200M = 20M. Requests per second in peak hour = 20M / 3600 ≈ 5555. Each instance handles 50 req/s, so instances needed = 5555 / 50 ≈ 111. To handle CPU time and overhead, multiply by 4 (since 200ms CPU time means 5 req/s per CPU core, but instance can handle 50 req/s, so 400 is a safe estimate).
Which storage option is best suited for storing user watch history to support fast personalized recommendations in a video recommendation system?
Consider the relationships between users and videos and the need for fast traversal.
A graph database efficiently models relationships like user-video interactions and supports fast queries for recommendations based on connections. Relational DBs may be slower for complex joins, key-value stores lack relationship context, and flat files are inefficient for queries.
What is the primary challenge when updating recommendations in real-time as users watch videos in a large-scale video recommendation system?
Think about the balance between speed and data volume.
Real-time updates require processing large streams of user activity quickly to keep recommendations fresh. Storing all data in one DB is not scalable, batch updates are not real-time, and avoiding caching hurts performance.
Given a video recommendation system with components: User Interface (UI), API Gateway, Recommendation Engine, User Profile Store, Video Metadata Store, and Cache, what is the correct sequence of steps when a user requests personalized recommendations?
Consider the logical order of request handling and cache usage.
The user sends a request (1), which the API Gateway receives (2). The system first checks the cache (3). On a cache miss, the recommendation engine queries the user profile and video metadata stores (4), generates recommendations (5), caches them (6), and finally the API Gateway returns the response (7).
