Search⌘ K
AI Features

Getting Ready: The Facebook System

Explore the design of the Facebook system by understanding its core functionalities such as user profiles, friend connections, groups, pages, and privacy settings. Learn to break down complex features using a bottom-up object-oriented approach, while preparing to discuss design patterns and diagrammatic representations in an interview context.

Problem definition

Facebook is a social media platform for users to connect with people and engage with different types of media and content. Users can connect with others by sending friend requests or using the direct messaging feature. Each user has a profile where they can create posts to share with their friends. Facebook also allows its users to create pages regarding a topic of interest and groups to form a community of similar people. Facebook generates a personalized feed for its users based on their friends, liked pages, groups, and the content they engage with to ensure the best experience.

The Facebook home page of a user
The Facebook home page of a user

Expectations from the interviewee

Facebook offers multiple functionalities to its users. It is important to narrow down what components you will include in your Facebook design. The section below provides an overview of some of the main expectations the interviewer will want to hear you discuss in more detail.

Discoverability

Developing a better understanding of how Facebook’s discoverability works is important. The interviewer would expect you to ask the questions listed below:

  • How are users able to search other users’ profiles?

  • Can users search other users using their phone numbers and email addresses?

Friends and following

The “Add friend” feature of Facebook is its most renowned feature. Make sure to ask the interviewer the questions provided below:

  • How are users able to add other users as friends?

  • How can users follow or unfollow other users without becoming a direct connection?

Groups and pages

Groups and pages on Facebook create a space for like-minded individuals. Make sure to define your requirements. You may ask the interviewer the questions listed below:

  • How can users create groups and pages besides their user profiles?

  • What are the criteria for joining a group? Can a user join a group if they are not friends with the creator of the group?

Privacy

You can ask the following questions to learn about the privacy feature in your design:

  • How will the system handle privacy lists with certain content displayed only to specified connections?

  • How do users set the privacy of groups? How does this change the way members and non-members interact with the group?

Alerts

Notifications and alerts allow users to stay updated with the activity in their circle. Therefore, you may want to understand how alerts will work in your system. You may ask the questions listed below:

  • How will users be notified of pre-selected events?

  • How much control do users have in choosing what notifications they can receive?

Design approach

We’ll design Facebook using the bottom-up design approach. For this purpose, we will follow the steps below:

  • Identify and design the smallest components, like a post and comment, first.

  • Use these small components to design bigger components, for example, pages, groups, and profiles.

  • Repeat the steps above until we design the complete Facebook platform.

Design pattern 

During an interview, it is always a good practice to discuss the design patterns that Facebook follows. Stating the design patterns gives the interviewer a positive impression and shows that the interviewee is well-versed in the advanced concepts of object-oriented design.

Try to answer the following question. If you are not familiar with design patterns, don’t worry! You can learn about them by asking, “Define design patterns.”

Which design pattern(s) should be used to design the Facebook system? Please elaborate on your choice(s).

Let’s explore the requirements of Facebook in the next lesson.