Learning pathsA
GUIDED PRACTICE

Hard Timed Practice

Design a feed from posts and follow relationships with hybrid fanout, ranking, stable pagination, privacy changes, and deletion.

Run a 45-minute self-guided capstone combining hybrid feed fanout, ranking, privacy, and recovery. Give a complete design before using any hints.

This is a timed, self-guided mock interview. No live interviewer, automated evaluator, or AI feedback is connected. Use the on-page timer or your own timer, speak your decisions aloud, and save your draft before reviewing the model.

Scenario and constraints

  • 10 million daily readers; highly skewed follower counts.
  • Ordinary author: 500 followers and two posts/day.
  • Largest author: 20 million followers and ten posts/day.
  • Privacy revocation must be enforced before content is returned.

Your deliverables

  • Minutes 0–7: clarify the feed contract, visibility invariant, and workload.
  • Minutes 7–17: define source records, candidate projections, and cursor semantics.
  • Minutes 17–30: justify hybrid fanout with arithmetic and draw both paths.
  • Minutes 30–40: respond to celebrity overload and privacy revocation.
  • Minutes 40–45: summarize risks, metrics, and a safe projection rebuild.

Reason about this sequence

Private post enters feed cache → Viewer loses access → Projection removal is delayed → Read checks current visibility → Post filtered before response
Scroll to inspect the diagram, or open it at full size.

Figure — Private post enters feed cache → Viewer loses access → Projection removal is delayed → Read checks current visibility → Post filtered before response

For every step, annotate what is durable, what the caller knows, and which identity survives a retry. Identify the point where two concurrent actors could disagree. Do not assume a timeout means failure or a cache value grants ownership.

Interviewer follow-ups

  • A stale feed cache contains a newly private post.
  • A celebrity post causes a massive fanout backlog.
  • A retry inserts the same candidate twice.

Answer each follow-up using the same design first. If it breaks, change the smallest boundary that repairs the invariant and explain the new cost. Show whether the change adds latency, storage, coordination, or operational work.

Staged hints

Hint 1 — reveal

Answer: Hint 1 — Treat every precomputed feed entry as a candidate. The final read must still establish that this viewer can see this post now.

Hint 2 — reveal

Answer: Hint 2 — For ordinary authors, fanout-on-write inserts candidate IDs into follower inboxes. This makes reads cheap but multiplies writes. For authors with huge audiences, retrieve recent posts at read time to avoid enormous synchronous fanout. The threshold depends on follower count, posting rate, and follower activity, not a universal celebrity number.

Hint 3 — reveal

Answer: Hint 3 — A private post remains in a stale feed cache after the viewer is removed from the audience. If the renderer trusts the cached entry, privacy is violated. Recheck current visibility at an appropriate authority or use a provably current authorization mechanism before returning content. Asynchronous deletion cleanup alone is not sufficient for an immediate revocation requirement.

Evidence-based self-review

  • Hybrid fanout is justified with workload arithmetic.
  • Cached candidates do not grant permission to read content.
  • Stable identities and cursors handle retries and pagination.
  • Projection repair and operational backlog limits are clear.

Score each item 0 if absent, 1 if named without an enforceable mechanism, or 2 if the mechanism and a failure are explained. Record evidence from your own diagram beside the score. Then choose one weak decision, revise it, and repeat the relevant follow-up. This rubric is a learning tool, not a hiring forecast.

45:00Self-guided practice timer
The timer resets when you leave this page. Save your design separately.
Your challenge

How do you prevent an old feed entry from exposing a post after access is revoked?

Your design draft

Clarify assumptions, explain your approach, and test the difficult cases. Save your draft, then compare it with the study notes.

Read study notes

Self-review checklist

Self-guided practice. Automated AI feedback and code execution are not connected.