Design a Social Feed With Friend-Only Comment Visibility

Last updated: November 29, 2026

Quick Overview

Design a photo and text feed where each post is shared with the poster's friends (optionally a chosen subset), and a comment on a post is visible to a viewer only if the viewer is friends with the commenter.

Tencent
System Design
Software Engineer
Tencent
November 29, 2026
Software Engineer
System Design Round
System Design
Medium

0

0

0 solved


Design a photo and text feed where each post is shared with the poster's friends (optionally a chosen subset), and a comment on a post is visible to a viewer only if the viewer is friends with the commenter.

WeChat Moments has an unusual privacy model: you only see comments and likes from people you are also friends with, and posters can restrict each post to tags or exclude people. The interviewer checks whether a candidate can design timeline fan-out and then layer per-viewer filtering on top without breaking latency.

What the Interviewer Expects
  • Clarifies friendship model (mutual, bounded friend count) and visibility options
  • Chooses write fan-out to per-user timelines given bounded friend lists
  • Stores visibility rules with the post and enforces them at fan-out and read time
  • Filters comments per viewer using the viewer's friend set
  • Handles unfriending, blocking and post visibility edits
  • Discusses caching of friend sets and media delivery
Key Topics to Cover
Feed fan-out
Access control
Social graph
Caching
Privacy
Consistency
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • What happens to timelines when someone unfriends the poster?
  • How would you support 'only show the last 3 days' of my posts to others?
  • How would you count likes when each viewer sees a different subset?
  • How do you keep the feed fast for a user with 5000 friends?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Post text plus up to 9 images, visible to all friends, a tag group, or all except a list. Friends are mutual and capped (WeChat-like cap of about 10000). Viewer sees friends' posts newest first; on ea...

High-Level Design

Services: Post service (post records plus visibility rule), Media service (upload to object storage, serve via CDN), Timeline service (per-user list of post IDs), Comment service (comm...


Submit Your Answer
Markdown supported

Related Questions