Design Facebook News Feed
Design Facebook News Feed
Many systems design questions are intentionally left very vague and are literally given in the form of Design Foobar
. It’s your job to ask clarifying questions to better understand the system that you have to build.
We’ve laid out some of these questions below; their answers should give you some guidance on the problem. Before looking at them, we encourage you to take few minutes to think about what questions you’d ask in a real interview.
Clarifying Questions To Ask
Question 1
Q: Facebook News Feed consists of multiple major features, like loading a user’s news feed, interacting with it (i.e., posting status updates, liking posts, etc.), and updating it in real time (i.e., adding new status updates that are being posted to the top of the feed, in real time). What part of Facebook News Feed are we designing exactly?
A: We’re designing the core functionality of the feed itself, which we’ll define as follows: loading a user’s news feed and updating it in real time, as well as posting status updates. But for posting status updates, we don’t need to worry about the actual API or the type of information that a user can post; we just want to design what happens once an API call to post a status update has been made. Ultimately, we primarily want to design the feed generation/refreshing piece of the data pipeline (i.e, how/when does it get constructed, and how/when does it get updated with new posts).
Question 2
Q: To clarify, posts on Facebook can be pretty complicated, with pictures, videos, special types of status updates, etc… Are you saying that we’re not concerned with this aspect of the system? For example, should we not focus on how we’ll be storing this type of information?
A: That’s correct. For the purpose of this question, we can treat posts as opaque entities that we’ll certainly want to store, but without worrying about the details of the storage, the ramifications of storing and serving large files like videos, etc…
Question 3
Q: Are we designing the relevant-post curation system (i.e., the system that decides what posts will show up on a user’s news feed)?
A: No. We’re not designing this system or any ranking algorithms; you can assume that you have access to a ranking algorithm that you can simply feed a list of relevant posts to in order to generate an actual news feed to display.
Quest