Design a GitHub-like developer community
I was asked this
No reports yet. Sign in to say where you were asked it.
A system design interview question asked in Amazon's system design round, last asked Sep 2025. It tests social, feeds and scaling.
Design the backend for the social layer of a developer site like GitHub. Developers have profiles, follow each other, write posts that others comment on and like, read a home feed of posts from the people they follow, and get notified about new followers and comments. Reads, and feed reads above all, dominate traffic, and the system runs at very high request rates.
Requirements
- Functional: sign up, sign in and edit a profile; follow and unfollow users; create a post (text plus optional links); comment on and like posts; a home feed of recent posts from followed users (reverse chronological is fine); notifications when someone follows you or comments on your post.
- Non-functional: very high read TPS; low feed latency (pick and defend a p95, for example under 200 ms); define what must be strongly consistent and what may be eventually consistent; basic abuse protection (rate limits, spam).
Clarifying questions
- How many users, daily actives and posts per day? How many follows does a typical user have, and how big do the largest accounts get?
- How fresh must the feed be: is a post appearing a few seconds late acceptable?
- Is the feed purely chronological, or will it be ranked later?
- Do likes and comment counts have to be exact in real time?
- Are notifications in-app only, or also email and push?
What a strong answer covers
- APIs at the level of request and response shapes: profile, follow, post, comment, like,
GET /feed?cursor=, notifications. - A data model with its keys and indexes: users, follow edges (both directions), posts by author and time, comments by post, likes keyed by (post, user), notifications by recipient.
- Feed generation, decided: fan-out on write into per-user feed lists in a cache, fan-out on read for accounts with huge follower counts, and the hybrid that merges both at read time. Cursor pagination.
- Caching for the hot read paths (feed pages, post bodies, counters) and how caches are invalidated.
- Asynchronous work through a queue or stream: fan-out, notifications and counter updates, with idempotent consumers.
- Consistency choices: follow edges and posts durable and read-your-writes for the author; feeds, counts and notifications eventually consistent.
- Scaling and failure: sharding by user id or post id, replication, backpressure when fan-out falls behind, what happens when the cache or queue is down.
- Abuse: per-user and per-IP rate limits, spam checks on posts and comments.
Follow-ups
- A celebrity with 10 million followers posts: walk through what happens.
- Move from a chronological feed to a ranked one.
- Add following repositories and starring them as new activity types in the feed.
- A user deletes a post or blocks someone: how fast does it disappear from feeds?
Where it's asked
- Amazon · System design · Last asked Sep 202555 min · Design discussion
What it tests
social · feeds · scaling
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
