Archicise
Exercise

Design a Social Media Feed

Build a news feed system similar to Twitter or Instagram that aggregates and ranks content from followed users.

Functional Requirements

  • Display posts from followed users in a personalized feed
  • Support likes, comments, and shares
  • Real-time updates when new posts are created
  • Content ranking based on relevance and engagement
  • Support for different content types (text, images, videos)

Non-Functional Requirements

  • Feed generation under 100ms
  • Support users following thousands of accounts
  • Handle viral posts with millions of interactions
  • Consistent experience across devices

Questions to Consider

  • Will you use push (fanout-on-write) or pull (fanout-on-read)?
  • How do you rank posts for relevance?
  • How do you handle celebrity accounts with millions of followers?
Your Solution

Feed Generation Strategy

Choose between push vs pull feed models. Consider fanout-on-write, fanout-on-read, and hybrid approaches for different user types.