Social Media Feed

Build a Twitter/Instagram-style social feed with infinite scroll, likes, comments, follow system, and real-time updates.

Overview

Create a social media timeline. Users create posts (text + images), follow other users, like and comment on posts, and see a personalized feed. Implement infinite scroll with cursor-based pagination, optimistic like/unlike, and a follow-based feed algorithm.

The social media feed is the most commonly asked system design question in engineering interviews, and building a working implementation demonstrates understanding at a level that whiteboard discussions cannot match. You will implement the core feed generation algorithm, choosing between fan-out-on-write and fan-out-on-read strategies, and experience first-hand the trade-offs that Twitter and Instagram faced at scale.

The technical complexity spans multiple domains: a follow graph that determines which posts appear in a user timeline, denormalized counters for like and comment counts cached in Redis for read performance, optimistic UI updates that provide instant feedback while async operations complete in the background, and infinite scroll with cursor-based pagination that handles new posts being inserted at the top of the feed.

This is an advanced project that touches nearly every system design concept: data modeling, caching strategies, fan-out architecture, denormalization trade-offs, real-time updates, and image storage. For senior engineering interviews, being able to reference working code for each of these concepts is enormously powerful.

Interview questions

  • Fan-out-on-write vs fan-out-on-read?
  • How do I implement infinite scroll?
  • How should likes work?
  • What database schema is needed?
  • How do I handle image uploads for posts?
  • How do I build the follow/unfollow system?

Sign up free to read the full topic

More Projects topics

Start free on Cariara · Coding problems · System design studio