A social network is an online platform that enables users to connect with friends, share content, and interact with each other through likes, comments, and messages.
Core features include user profiles, friend relationships, a news feed, and the ability to post text, images, or other media.
In this chapter, we will explore the low-level design of a simplified social network in detail.
Let’s start by clarifying the requirements:
Before jumping into the design, it’s essential to clarify what features we’re expected to implement and what can be left out. This helps ensure a focused, manageable, and realistic scope for the interview setting.
Candidate: Should the system support both posts and comments?
Interviewer: Yes, users should be able to create posts and comment on posts. Comments should also support nested replies.
Candidate: Can users like both posts and comments?
Interviewer: For now, let’s support likes only on posts to keep the design simple.
Candidate: Should each user have a personal feed? If so, how should it be generated?
Interviewer: Yes, each user should have a personalized feed that shows posts made by their friends. You can start with a chronological ordering strategy.
Candidate: Is there a concept of privacy (e.g., public vs. private posts)?
Interviewer: Not required for this version. All posts are visible to a user's friends.
Candidate: Should we allow deleting or editing posts or comments?
Interviewer: No, you can omit editing and deleting functionality for now.
After the requirements are clear, the next step is to identify the core entities that we will form the foundation of our design.