Design the backend system for a social networking website primarily focused on sharing images (similar in spirit to an image-centric social app).
Users should be able to:
-
Sign up, log in, and manage a profile.
-
Upload images (with optional captions).
-
Follow/unfollow other users.
-
View a
feed
of images posted by accounts they follow.
-
Like and comment on images.
The interviewer specifically cares about how your design will handle foreseeable, large-scale user growth: potentially tens of millions of users, high write traffic for uploads and interactions, and very high read traffic for feeds.
Tasks
-
Clarify and state the key
functional
and
non-functional
requirements (e.g., latency, availability, consistency, durability).
-
Propose a
high-level architecture
, including major components/services (e.g., API gateway, user service, post/media service, feed service, databases, cache, object storage, CDN).
-
Design how
image upload and retrieval
works end-to-end.
-
Design how a user's
home feed
is generated and served efficiently at scale.
-
Explain how you will
scale the system
as the number of users and operations increases, including:
-
Horizontal scaling of stateless services.
-
Database sharding/replication strategies.
-
Caching and CDN usage.
-
Asynchronous processing and message queues.
-
Discuss key
trade-offs
(e.g., push vs. pull feed generation, consistency vs. latency) and how your choices handle high load and growth.
You can assume a cloud environment (object storage, managed databases, load balancers, etc.) is available.