Which of the following component sets best supports a scalable news feed generation system that handles millions of users with low latency?
Think about components that help with asynchronous processing and fast data retrieval.
Option A includes a message queue for asynchronous feed generation, a cache for fast access, and a database for persistence, which together support scalability and low latency.
When millions of users post updates simultaneously, which approach best handles the write load for news feed generation?
Consider how to smooth out spikes in write traffic.
Using a distributed message queue buffers incoming updates and allows asynchronous processing, preventing database overload and improving scalability.
Which statement correctly describes a tradeoff between push and pull models for generating user news feeds?
Think about when feed data is prepared and stored.
Push model precomputes and stores feeds, reducing latency but using more storage. Pull model computes feeds on demand, saving storage but increasing latency.
What is the main challenge caused by high fan-out (users with millions of followers) in news feed generation?
Consider what happens when one user’s post must be delivered to many followers.
High fan-out means one post must be copied to many feeds, increasing write operations and storage needs, known as write amplification.
Estimate the daily storage needed if 10 million users each post 2 updates per day, and each update is stored in the feeds of 500 followers. Each feed entry is 1 KB.
Calculate total updates, multiply by followers, then by size.
10M users * 2 updates = 20M updates/day. Each update stored in 500 feeds: 20M * 500 = 10B entries. Each 1 KB = 10B KB = 10 TB.
