Design a Personalized Recommendation System
Design event ingestion, candidate retrieval, ranking, and serving for a bounded personalized user-item catalog.
Problem statement
For this exercise, choose one focus at the requirements checkpoint and repeat the same focus at the beginning of every submitted artifact. The service/API focus asks for a system diagram, product behavior and API design.
Use the neutral user-item catalog, consented interaction events, eligibility rules, pagination, latency and freshness assumptions below. Treat retrieval and ranking as replaceable services with defined inputs and outputs; a supplied ordering or existing ranker is sufficient.
Design recommendation requests, interaction feedback, data ownership, serving, caches, failure responses and safe fallback. Recommendation algorithms, model architectures, learning-to-rank comparisons, optimizer equations and probability calibration are outside this focus.
The ML system focus retains all learned-model and deployment questions below. Model-specific requirements, rubric signals and samples apply only to the ML focus; candidates in the service/API focus are evaluated on the corresponding service questions instead.
Both focuses use the same product facts and scale, at every target level.
Retained ML system focus and product context: Design a zero-to-one personalized recommendation system for a neutral, bounded user-item catalog with implicit interaction events.
The system must retrieve, rank, and serve a personalized list while preserving reproducible decision versions, current eligibility, and a safe fallback. The catalog, signals, freshness target, and workload below are labeled practice assumptions.
For this exercise, include one learned probability head for a clearly named engagement outcome after an actual impression, and evaluate its calibration on mature observed exposures before a release. You may choose and justify the observable outcome; no particular calibration method is required.
For one short-video deployment of this general recommender, also balance short interactions with completion; later retention may be supporting evidence when it is instrumented and mature. Consider how position-biased feedback, training/serving feature skew, and self-reinforcing exposure can distort a ranking change.
A bounded, policy-approved evaluation or exploration slice is available for this exercise. Choose and defend the model family, allocation, and objective weights; no particular algorithm or percentage is required.
For the trained ranking model, also choose an optimizer, write its parameter-update equation with every symbol defined, and justify that choice against at least one plausible alternative. No particular optimizer is required.
For a news-feed deployment of this same recommender, content quality is only one input: choose and justify at least two non-content ranking signal families, and show how their source data become reproducible training and serving features. The particular signals and model family are design choices for this exercise.
For a real-time deployment of this same system, compare concrete serving choices that trade recommendation quality against the first-page latency target, including cache and nearline feature behavior. Explain what you would monitor after launch and how that evidence would guide a compatible model iteration.
For an LLM-assisted deployment of this same recommender, assume short item descriptions and opt-in user preference text are available. Propose and justify one bounded role for an LLM in semantic representations, candidate generation, or ranking.
Compare its incremental recommendation value with a conventional non-LLM baseline while preserving the first-page deadline, eligible-item boundary, privacy, reproducible versions, cost control, and a safe fallback.
These text inputs and serving choices are exercise assumptions; no chatbot, model family, or per-request generation is required.
For a merchant-post deployment of this same recommender, assume eligible merchant posts are the items shown to users and consented user comments on those posts are available as interaction evidence.
Explain how comment activity, and optionally permitted text, can inform retrieval or ranking without assuming that every comment expresses positive interest. Keep comment-derived features time-bounded and versioned, honor opt-out and deletion, and evaluate the change on actual displayed recommendations.
For a two-tower retrieval deployment of this same short-video recommender, assume one tower encodes the user and the other encodes the video, and that about 50,000 new videos a day should become retrievable within one hour.
Choose how often to retrain the towers, embed new videos, rebuild the nearest-neighbor index, and refresh user vectors, and keep query and index vectors compatible. Also choose an embedding size, meaning how many numbers each user and video vector holds.
Explain how that size trades retrieval and ranking quality against index memory, approximate nearest-neighbor (ANN) search time, the time to fetch vectors and features within the 200 ms first-page target, and training and serving cost. ANN search finds close vectors without comparing the query with every video.
The new-video figures are practice assumptions, and no particular schedule or embedding size is required.
What to build
- Collect consented impressions, clicks, saves, and completions with stable event identities. In the merchant-post deployment, also collect eligible comment and deletion events with post, merchant, user, and event-time identity.
- Service/API focus: return a bounded eligible recommendation list through a versioned retrieval/ranking service contract; an existing ranking implementation is supplied. ML focus: Retrieve a bounded multi-strategy candidate set and rank eligible items using pinned model and feature versions, with a safe popularity fallback. For a news-feed deployment, justify non-content ranking inputs and their point-in-time feature lineage. In the LLM-assisted deployment, use one justified and versioned LLM-derived signal or output only where it improves eligible recommendations against a conventional baseline. In the two-tower deployment, refresh the towers, video embeddings, nearest-neighbor index, and user vectors on justified schedules with compatible versions, and justify the embedding size against quality, memory, latency, and cost.
- Serve a paginated personalized list with explanation and policy metadata.
- Service/API focus: record consented, retry-safe interaction feedback tied to the displayed recommendation and keep serving projections within the stated freshness target. ML focus: Measure outcomes and update nearline features without leaking future data into training. Validate the probability head on held-out actual exposures, including supported candidate-source or position slices. The merchant-post deployment must preserve point-in-time comment feature lineage and prevent deleted or opted-out comments from continuing to influence serving.
- ML focus only: Operators can compare ranking changes on actual displayed exposures with their positions and policy assignments, check offline/online feature consistency, and give eligible new items a bounded measured path into training.
At scalePractice assumption
- Ten million daily users, one million active items, and 200 million interaction events per day.
- The first page contains 20 items and should serve within 200 ms at p95.
- Interaction features should affect recommendations within five minutes while model releases occur daily.
- Every response filters unavailable or disallowed items before final ranking.
- In the two-tower deployment, about 50,000 new videos arrive per day and each should become retrievable within one hour of passing eligibility.