7
Back to Problem Dungeon

Social Feed

hard

Step 1: Requirements

Requirements

Questions to ask

  • How is the feed ranked? Chronological, algorithmic, or both?
  • What content types? (text, image, video, link, poll)
  • How does following work? (follow users, follow topics?)
  • Do we need real-time updates (new posts appear live)?
  • What is the pagination strategy? (cursor-based? offset?)
  • Do we need post interactions (like, comment, share)?

Functional requirements

  1. User creates posts of various types
  2. User follows/unfollows other users
  3. Feed shows posts from followed users, ranked by algorithm
  4. Paginate feed efficiently (cursor-based)
  5. Notify followers when a user posts
  6. Support likes and comments

Non-functional requirements

  • Feed generation < 200ms for the first page
  • Support users following thousands of accounts
  • Recent posts prioritized; old posts eventually drop off
  • Read-heavy (1000:1 read-to-write ratio)

1 / 7 — Requirements