← Questions

Design post privacy and visibility controls

0
MetaSystem designLast asked Feb 2026

A system design interview question asked in Meta's system design round, last asked Feb 2026. It tests access control, social graph and feeds.

Design the privacy system for posts on a large social network. An author picks who can see each post, and every read path (the news feed, the post's direct URL, the author's profile) must enforce that choice. The system serves very high read traffic behind caches, and friendships and privacy settings change all the time.

Requirements

  • Functional: each post has one audience: Public, Friends, Friends of friends (optional), Only me, or Custom (an allowlist of people or groups, a denylist, or both).
  • Functional: enforce the audience on every read, including feed and direct link.
  • Functional: an author can change a post's audience; people can friend, unfriend and block at any time, and reads must reflect the change.
  • Non-functional: very high read QPS with low latency; works with caching without ever serving a post to someone not allowed to see it.
  • Out of scope: detailed regulatory auditing.

Clarifying questions

  • How fast must a change take effect: immediately for unfriend and block, or within seconds?
  • How many friends can a person have, and how large can a custom list be?
  • Does a block override every other setting?
  • Is friends-of-friends required, given its cost?
  • Are comments and shares covered by the post's audience, or only the post itself?

What a strong answer covers

  • Data model: the post stores its audience type plus references to allow and deny lists; friendship edges in a graph store; groups and custom lists as their own objects.
  • A single authorization function can_view(viewer, post) used by every read path, with an evaluation order: block and deny first, then author, then audience type.
  • Checking at read time rather than precomputing who may see each post, and why: precomputation breaks as friendships change. Feed candidates are filtered by this check before ranking or display.
  • Friends-of-friends: the expensive case; bounded mutual-friend checks, cached friend sets, or bloom filters, and the trade-offs of each.
  • Caching: cache post content and the visibility decision separately; key decision caches by (viewer, post) or invalidate them on friendship and setting changes; never cache a rendered post in a shared cache without the viewer in the key.
  • Changes: an audience change or unfriend invalidates the relevant caches, and the system fails closed when the check cannot be completed.
  • Performance at scale: batch checks for a page of feed candidates, sharding of the graph, and the latency budget.

Follow-ups

  • Someone unfriends the author and immediately reloads a cached feed. How do you make sure the post disappears?
  • How do you make friends-of-friends fast for a person with 5,000 friends?
  • A post is shared by someone else. Whose audience applies?
  • Search returns posts as well. How do you keep the search index from leaking private posts?

Where it's asked

  • Meta · System design · Last asked Feb 202645 min · Design discussion; either an LLM-agent system or a classic product system · Nominally AI-enabled, but the assistant is often not used

What it tests

access control · social graph · feeds

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing