Quick revision
The short answer
A ranked feed is a new capability, not a change to the sort order: it needs event collection, feature pipelines, model training and model serving, plus an experimentation system and agreed success metrics before the first model ships. I would form one team that combines data science, data engineering and backend engineering with clear ownership of a ranking service, choose where models run from the latency budget, plan user controls and the rules on recommender systems in our markets, and move in stages from simple heuristics to learned ranking for a share of users, with rollback at every stage.
What to remember
In this answer, we saw that ranking needs event collection, feature pipelines, training and serving that a chronological feed does not have, and that experimentation and agreed metrics must exist before the first model. We formed one combined team owning a ranking service with a clear contract, chose model serving from the latency budget with a chronological fallback, planned user controls and recommender regulations from the start, and staged the rollout from a heuristic to a learned model with rollback at each step.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
A ranked feed is a new capability, not a change to the sort order: it needs event collection, feature pipelines, model training and model serving, plus an experimentation system and agreed success metrics before the first model ships. I would form one team that combines data science, data engineering and backend engineering with clear ownership of a ranking service, choose where models run from the latency budget, plan user controls and the rules on recommender systems in our markets, and move in stages from simple heuristics to learned ranking for a share of users, with rollback at every stage.
Why this question is asked
Requests like this sound small to the people making them: instead of newest first, show the most interesting first. For engineering it is a change of kind. A chronological feed is a database query; a ranked feed is a product that learns from behaviour, and it brings new data, new skills, new risks and new regulatory obligations. Interviewers ask this of senior leaders to see whether they can turn an ambition into a plan that the organisation can actually carry out. In this answer, we will look at what the current system lacks, why measurement comes first, how to organise the people, where the model should run, what the outside world requires, and how to stage the rollout.
1What a Chronological Feed Does Not Have
Today the feed service probably reads post ids for a user, sorted by time, and returns them. Nothing in that system knows what a user found interesting. To rank, we need four things it does not have. First, event collection: impressions, clicks, likes, dwell time and hides, logged reliably with the context in which the post was shown. Second, feature pipelines that turn those events into signals such as how often this user interacts with this author, available both for training and at request time. Third, model training, with reproducible datasets. Fourth, model serving, which scores a few hundred candidates per feed request within a strict time limit.
Notice that most of this is data engineering, not modelling. In my experience the first months go to logging and pipelines, and a leader who plans only for the model will be surprised. So the first part of the plan is to start collecting the events now, even before any ranking exists, because a model can only learn from history we have recorded.
2Measure Before You Rank
Before the first model, we need two things in place: an experimentation system that can show a different feed to a random share of users and compare outcomes, and agreed success metrics. Without them, any result is an argument rather than a fact. If ranking raises clicks by 6 percent but reduces the number of people who come back next week, was it a success? That question must be settled with product leaders before the experiment, not after.
I would agree on one primary metric that reflects long-term value, such as seven-day retention or meaningful interactions per user, and a few guardrail metrics that must not get worse: posts from friends seen, hides and reports, latency, and complaints. The A/B testing platform assigns users to groups consistently, logs which ranking version served each request, and computes the metrics with statistical confidence. Building it is weeks of work, and it pays for itself in every later decision.
3Organising the Team
Ranking fails when it is split across groups that throw work over walls: data scientists build a model in a notebook, data engineers rebuild the features differently, and backend engineers are handed a file to serve. Small differences between training features and serving features silently ruin quality.
So I would form one team, perhaps eight to ten people, combining data scientists, data engineers and backend engineers, with a single owner of the ranking service and its metrics. The existing feed team keeps candidate generation, the job of picking which few hundred posts are eligible, and the delivery path. The ranking team owns scoring, features and experiments. Clear interfaces between them, a candidates-in, scores-out contract with a time budget, let both teams move independently.
- Event collectionimpressions, clicks, hides, dwell time, with request context
- Feature pipelinessame definitions for training and serving
- Trainingreproducible datasets, offline evaluation
- Model servingscores about 500 candidates in under 50 ms
- Feed service (Java)candidates, ranking call, fallback to time order
- ExperimentationA/B groups, primary metric, guardrails
6 layers, from the top down. Step through them one at a time.
Only one of these six layers is the model itself.
4Where the Model Runs
The feed probably has a latency budget of around 200 milliseconds end to end, and ranking might get 50 of them. That number decides the serving design. One option is a Java feed service that calls a separate model server over gRPC, such as one built for the model framework the data scientists use. It keeps models and Java code independent and lets the team use GPUs if needed, at the cost of a network hop and another system to operate. The other option is embedding the model in the Java service, for example a gradient-boosted tree model or an ONNX model loaded through a Java runtime, which avoids the hop and is simple for small models but ties model releases to service deploys.
I would choose from measurements: start embedded if the first models are small tree models that score 500 candidates in a few milliseconds, and move to a model server when models grow. In both cases the Java service must have a fallback. If ranking times out, it serves the chronological order, so a ranking outage degrades quality, not availability.
5User Controls and the Rules on Recommenders
Ranking changes what people see, and both users and regulators care. Users should be able to switch back to a chronological view, see why a post was shown in simple terms, and say they want less of something. These controls also make the product easier to defend when a ranking mistake becomes public.
Regulation depends on our markets, and I would ask legal to map it early. In the EU, for example, the Digital Services Act requires online platforms to explain the main parameters of their recommender systems, and very large platforms must offer at least one option not based on profiling; data protection rules govern which behavioural data we may use. The plan should include these as requirements from the first stage, because retrofitting a non-personalised option into a mature ranking stack is expensive.
6Moving in Stages With Rollback
I would not let the first launch be a learned model for everyone. Stage one is a simple heuristic, such as boosting posts from people the user interacts with often and posts with early engagement, shipped to 5 percent of users. It proves the logging, the experiment system and the serving path, and it often delivers most of the early gain. Stage two is a learned model for 10 percent, compared against the heuristic. Stage three widens to everyone only if the primary metric improves and no guardrail breaks. Every stage has a switch that returns users to the previous ranking within minutes.
- Collect events and build A/B platformagree primary metric and guardrails
- Heuristic ranking for 5% of usersproves logging and serving
- Metric up, guardrails held?YesLearned model for 10%NoRoll back, investigate
- Learned model beats heuristic?YesWiden gradually to everyoneNoKeep heuristic, improve features
- Keep chronological option and fallbackat every stage
5 steps in order. Play them, or step through them one at a time.
7Follow-up questions
How would you explain the timeline to product leaders who expect ranking next quarter?
I would show them the six pieces and point out that a heuristic for a small group can ship within a quarter, while learned ranking needs several months of logged events first. Giving them an early, measured result keeps the programme credible, and the experiment data from stage one tells us whether the bigger investment is worth it.
What is the biggest technical risk?
Training and serving features that differ. If the model was trained on a feature computed one way in a batch job and served a slightly different value at request time, offline results look great and online results disappoint. A shared feature definition and logging the served features for training avoids most of it.
How do you stop ranking from optimising for outrage or clickbait?
By choosing a primary metric tied to long-term value rather than raw clicks, holding guardrails such as hides and reports, reviewing samples of top-ranked content regularly, and giving users controls. Metrics shape what a model learns, so this is a leadership decision, not a modelling detail.
8Conclusion
In this answer, we saw that ranking needs event collection, feature pipelines, training and serving that a chronological feed does not have, and that experimentation and agreed metrics must exist before the first model. We formed one combined team owning a ranking service with a clear contract, chose model serving from the latency budget with a chronological fallback, planned user controls and recommender regulations from the start, and staged the rollout from a heuristic to a learned model with rollback at each step.
Open with
I would first explain that ranking is a new capability rather than a different sort order. We would need reliable event collection for impressions, clicks and hides, feature pipelines, model training and a serving path that scores a few hundred candidates in tens of milliseconds, and the current chronological feed has none of that.
Then, if they want more
So I would start logging events immediately. Before any model, I would build A/B testing and agree with product on one primary metric, something like seven-day retention, plus guardrails such as hides, reports and latency, because otherwise we cannot judge results.
On the organisation side, I would form one team of data scientists, data engineers and backend engineers owning a ranking service, with a clear contract to the feed team: candidates in, scores out, within a time budget.
Where the model runs depends on that budget; small models can run inside the Java service, larger ones behind a model server over gRPC, and in both cases a timeout falls back to chronological order. I would bring legal in early on recommender rules, for example the DSA in the EU, and give users a chronological option and simple explanations.
Then I would roll out in stages: a heuristic for five percent of users, a learned model for ten percent, and wider only when metrics hold, with a switch to roll back at each stage.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Product wants to add ranked, personalised feeds instead of chronological ones. As the...": https://scrivio-interview-library.netlify.app/architecture/backend-system-design/3226433c75/