Design a Social Feed and Post Detail Experience
Design frontend and backend boundaries for a paginated feed and interactive post detail view.
Problem statement
For this exercise, assume authenticated users follow accounts, page through a ranked social feed, open a post detail view, and like or comment on a post. The client applies optimistic like and comment updates, then reconciles them with authoritative backend state.
Feed pages must remain stable while new content arrives, and opening a post must not require refetching unchanged media metadata already present in the feed. Post creation, recommendation-model training, direct messaging, ads, and moderation tooling are outside scope.
What to build
- A user can page through a stable ranked feed and refresh to discover newer items without duplicating already viewed entries.
- A user can open a post detail view with media, current engagement state, and paginated comments.
- A user can like or comment optimistically while retries and rejected mutations reconcile to one authoritative outcome.
At scale
- For this exercise, assume 10 million daily users, peaks of 100,000 feed reads and 20,000 engagement mutations per second.
- For this exercise, target first useful feed content within 800 milliseconds p95 and post-detail data within 500 milliseconds p95 after navigation.
- For this exercise, feed ranking may lag new content by one minute, while accepted likes and comments should reconcile within five seconds.
- For this exercise, feed pages contain at most 30 posts and comment pages contain at most 50 comments.