Skip to content
Code by Pawpu

System Design Simulator

News Feed

Design a social or product feed with follow graphs and ranking.

Loading simulator…

How the challenge works

  • Celebrity fan-out on write explodes. Hybrid pull for huge follow graphs is the usual escape hatch.
  • Precompute a short cached timeline. Rank asynchronously.

Key concepts

Fan-out on write

Works when most users have a modest follower count.

Cache as the product

The home API should read a prepared list, not run a graph query live.

Common mistakes

  • JOIN follows × posts on every homepage load.
  • Blocking publish until ranking finishes.

Recommended architecture

  • API + cache timeline, database for graph and posts, queue/workers for fan-out and ranking, CDN for media.

Interview tips

  • Ask what 'seen' means and whether ranking is personal or chronological.

Related challenges

Built by Al Beltran