Design a Privacy Control System

Quick Overview

Design a privacy and access control system for social media posts. Support visibility settings like Only Me, Friends Only, Custom Lists, and Public. Cover efficient access checks at read time and handling cascading privacy changes.

Meta
System Design
Software Engineer
Meta
Software Engineer
System Design Round
System Design
Medium

0


Design a privacy and access control system for social media posts. Support visibility settings like Only Me, Friends Only, Custom Lists, and Public. Cover efficient access checks at read time and handling cascading privacy changes.

Meta asks this in its system design round because privacy checks sit on the hot path of every feed and profile read across Facebook and Instagram. The interviewer is checking whether you can make the visibility check (Only Me, Friends, Custom Lists, Public) fast at read time and keep it correct when a user changes settings or unfriends someone.

What the Interviewer Expects
  • Model visibility as an attribute of each post plus references to friend lists or custom audience lists
  • Design a read-time access check that is fast (cached friend graph, set membership) and fails closed
  • Explain how cascading changes (unfriend, list edits, bulk 'limit past posts') propagate without rewriting billions of rows
  • Choose consistency deliberately: privacy tightening must take effect immediately, loosening can lag
  • Plan caching and cache invalidation for the friend graph and list membership
  • Include audit logging and testing so privacy regressions are caught
Key Topics to Cover
Access control lists
Social graph lookups
Read-time authorization
Cascading privacy changes
Caching and invalidation
Consistency trade-offs
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
  • A user unfriends someone. How do you guarantee that person cannot see Friends-only posts on their next request?
  • How would you support 'Friends except Alice' efficiently?
  • How do you apply privacy filtering when building a feed of hundreds of candidate posts?
  • How would you handle a user changing all past posts to Friends only?
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

Functional Requirements

  1. Visibility Settings: Users can set visibility for their posts as 'Only Me', 'Friends Only', 'Custom Lists', or 'Public'.
  2. Access Control: Implement efficient a...
Capacity Estimation

Capacity Estimation

Assuming Meta has approximately 3 billion users, let's estimate the scale:

  • Posts per User: Average of 100 posts per user.
  • Total Posts: 3 billion users * 100 posts/u...

Submit Your Answer
Markdown supported