0%
Product Architecture Interviews: User Flows, APIs, Data Models, Feeds, Real Time and Privacy
Feeds and Timelines
Almost every social or content product has a feed somewhere: a home timeline, a following tab, a list of new listings, a stream of activity from your team. In a product architecture interview the feed is often the deep dive the interviewer cares about most, because it touches every layer at once. It needs a data model for who follows whom, an API that pages through results, storage that can serve millions of reads per second and a policy for what appears first. Before any of that, though, a feed is a promise to the user, and the architecture follows from which promise you make.
This lesson works through feeds the way you would in the interview. First the product promise, chronological or ranked. Then the core write path decision, fan out on write against fan out on read and the hybrid that real products use. Then storage and pagination, including what happens when new posts arrive while someone scrolls. Then ranking at the level of detail a product round expects, with seen state and injected content. Finally the freshness against cost trade-off and a script for running the feed deep dive in about ten minutes. The data model for posts and follows belongs to the previous lesson and real time delivery belongs to the next one, so both are referenced here only where the feed depends on them.
The feed is the product's front page
When a user opens the app, the feed is usually the first thing they see, and its first screen is the moment the product either feels alive or feels empty. That has two architectural consequences. First, the feed read is the hottest path in the system. A product with ten million daily users who open the app eight times a day serves eighty million first pages a day, close to a thousand per second on average and several times that at the evening peak. Second, the latency the user notices is the time to the first screen, not the time to load everything. A design that returns the first ten items in two hundred milliseconds and the rest lazily beats one that returns a hundred items in a second.
Notice the shape of a typical feed read. The feed service does not usually store whole posts in the feed. It stores a list of post ids for each user, reads a slice of that list, then hydrates the ids into full items by fetching post bodies, author names, avatars, like counts and whether the viewer has liked each one. Hydration is a batch read against several services or caches, and it is often where the latency actually goes. Saying this out loud in the interview shows that you know a feed is two problems: deciding which ids to show and turning ids into something renderable.
Chronological feeds: a simple promise
A chronological feed promises that you will see everything from the accounts you follow, newest first. The promise is easy to explain and easy to test. If a friend posted ten minutes ago and you refresh, the post is at the top. Users trust chronological feeds because they can reason about them, and some products keep a chronological view precisely because power users ask for it.
The architecture is correspondingly simple. Ordering is by creation time, or by a monotonically increasing id that encodes time. Pagination is a cursor on that ordering. There is no model to train, no feature store and no ranking service. The hard part is entirely the fan out question covered in the next section: how to assemble the newest posts from hundreds of followed accounts quickly.
The weakness of chronological order is that it is unforgiving at volume. A user who follows a thousand accounts and opens the app twice a day sees only the last hour of posts and misses everything that mattered from the morning. Accounts that post constantly crowd out accounts that post rarely. For products where users follow many sources, that problem eventually pushes teams towards ranking.
Ranked feeds: a different promise
A ranked feed promises that the most relevant items appear first, whatever their age. Relevance is a prediction: how likely is this viewer to like, comment, share, watch to the end or simply stop scrolling on this item? The product decides which outcomes it values, a model predicts them and the feed sorts by a combined score.
This changes almost everything downstream. Ordering is no longer stable, because scores change as features change, so a simple time cursor no longer describes a position in the list. The feed needs to remember what the user has already seen, otherwise the same high scoring item appears at the top of every session. Fresh posts compete with older ones, so the product has to decide how much freshness is worth. And the feed now includes content the user did not explicitly ask for, such as suggested posts and ads, which raises questions of blending and labelling.
Mixed designs and multiple tabs
Many products offer both. A home tab is ranked and a following tab is chronological, or the feed is ranked but has a recent posts section at the top. In an interview it is worth naming this explicitly, because it tells the interviewer that you see the choice as a product decision with costs on both sides rather than a technical preference. It also shapes the architecture: if both views exist, the storage has to support both a time ordered read and a candidate gathering step for ranking, and they can share the same underlying inbox of post ids.
Which one to propose
The safe opening in an interview is to propose a chronological feed for the first working design and to say that you will add ranking as a deep dive if the interviewer wants it. The chronological feed lets you settle the fan out model, the storage and the pagination cleanly. Ranking then becomes a layer on top: candidate generation reads from the same inbox, and scoring reorders it. If the prompt makes relevance central, such as a short video product where users follow nobody at first, say so and design for ranking from the start, because there is no follow graph to make a chronological feed meaningful.
Ask the questions that decide it. How many accounts does a typical user follow? How often do they open the app? Is there content from outside the follow graph? Does the product need users to see every post from close friends, such as in a family or team app? The answers often make the choice for you.
What the interviewer listens for
In this part of the interview the interviewer is checking product sense more than infrastructure. Do you know what the user expects to see when they refresh? Can you name what breaks when you move from chronological to ranked, such as cursors and repeated items? Do you separate deciding which ids to show from hydrating them? A strong candidate states the promise in one sentence, names its consequences for pagination and freshness and moves on to the fan out decision with a clear target, such as first screen under three hundred milliseconds at the evening peak.
Write the target down next to the design. It turns the later choices into arithmetic instead of opinion. If the hydration step needs three downstream calls of fifty milliseconds each in parallel, plus a forty millisecond inbox read, you have budget left for a ranking call. If the inbox read alone takes two hundred milliseconds because it scans posts from five hundred followed accounts, the design needs to change, and the next section is about exactly that change.
Say in one sentence what the feed promises, such as newest first from people you follow or most relevant first from anyone. Pagination, freshness, seen state and cost all follow from that sentence, so the interviewer can check every later choice against it.