System Design: Pin’s Home Feed Recommendation System
Context
You are designing an end-to-end recommendation system for Pin’s personalized home feed at large scale (hundreds of millions of MAUs). The feed should be relevant, diverse, safe, fresh, and fast to load. Assume tight latency budgets (p95 < 200 ms server-side for ranking) and continuous model and data updates.
Requirements
Design and explain the system covering the following areas:
-
Objectives and Metrics
-
Define short-term vs. long-term goals and success metrics.
-
Include primary and guardrail metrics, and how trade-offs are handled.
-
Data and Features
-
Enumerate data sources: user profile and behavior, content metadata/embeddings, graph/interaction signals, context (device, geo, time).
-
Outline feature engineering for retrieval and ranking, including aggregation windows, sequence features, graph features, and multimodal embeddings.
-
Candidate Generation (Retrieval)
-
Propose multiple complementary retrieval sources (e.g., content-based ANN, collaborative filtering, graph walks, follow/board/taste, trending/recency).
-
Deduping and blending strategy.
-
Ranking Architecture
-
Multi-stage ranking design (pre-ranking and final ranking) and scoring.
-
Multi-objective modeling (e.g., CTR, saves, dwell/quality, retention), calibration, and source normalization.
-
Post-ranking controls and constraints.
-
Feedback Loops and Explore/Exploit
-
Handling position and selection bias, delayed/long-horizon rewards.
-
Exploration strategy (e.g., MAB, Thompson sampling), logging policy, and debiasing.
-
Cold-Start
-
Strategies for new users and new items.
-
Diversity, Freshness, Novelty
-
Controls and algorithms to maintain topical/category diversity, avoid duplicates, and promote fresh content.
-
Abuse, Spam, and Safety
-
Defenses against low-quality content, spam, cloaking, bots, and unsafe content.
-
Privacy and Compliance
-
Data minimization, retention, consent, user controls, regional compliance.
-
Evaluation
-
Offline evaluation (metrics, datasets, bias correction) and online A/B testing (powering, guardrails, interference, holdbacks).
-
Scalable Low-Latency Architecture
-
End-to-end training and serving architecture: logging/ingestion, feature store (offline/online parity), vector index, ranking services, caching, orchestration, monitoring, and alerting.
-
Latency and availability targets, fallbacks, and rollbacks.