Design the backend for a “developer community” product inspired by GitHub’s social layer.
Core requirements
-
Users can
sign up/login
and manage a profile.
-
Users can
follow/unfollow
other users.
-
Users can create
posts
(text + optional links), and other users can
comment
and
like
.
-
Each user has a
home feed
showing recent posts from people they follow (reverse-chronological is fine).
-
Basic
notifications
: someone followed you / commented on your post.
Non-functional requirements
-
High read volume (feed reads dominate). Assume a large-scale system; discuss how you would handle high TPS.
-
Low latency for feed reads (p95 target you choose).
-
Reasonable consistency (define what must be strongly consistent vs eventually consistent).
-
Prevent obvious abuse (rate limiting / spam), at least at a high level.
What to deliver
-
APIs (high-level request/response shapes are enough).
-
Data model (tables/collections, key indexes).
-
Architecture (services, storage, cache, queues/streams).
-
Feed generation approach (fan-out on write vs fan-out on read), and trade-offs.
-
Scaling and reliability (sharding/partitioning, replication, backpressure, failure modes).