Design a Food Posts News Feed with Detail Modal and Comments
Context
You are building a social, news-feed-like feature inside a food discovery or delivery app. Users follow authors (people, creators, or restaurants). The home feed shows a list of recent and relevant food posts. Tapping a post opens a detail modal with the full post content and comments.
Requirements
-
UI behavior
-
Feed items show: title, author, and comment count.
-
Selecting a feed item opens a detail modal with full post information and a paginated comments list.
-
Deliverables
-
Data model for users, follows, posts, comments, feed, and counters.
-
APIs for: list feed, fetch post detail, and post comment. Include pagination and idempotency where relevant.
-
Pagination and ranking strategy for the feed.
-
End-to-end backend request flow after the API gateway, including services, message queues, databases, and caches.
-
How a new post is processed and propagated to follower feeds (fan-out vs fan-in).
-
Discussion of consistency, caching, indexing, rate limiting, and optimizations for latency and read/write throughput.
Assumptions (clarify during interview if needed)
-
Users see a personalized home feed from authors they follow, with light ranking over recency.
-
Scale target: millions of DAU, thousands of posts per second at peak, tens of thousands of comments per minute.
-
Mobile clients; images and videos are stored in object storage and served via CDN.