Design notification and feed recommenders
PinterestMachine Learning Engineer · OnsiteLast updated
This question tests the ability to design a dual-purpose recommendation architecture capable of handling real-time push notifications and personalized feed updates at scale.
System Design: Unified Recommendation Platform
Pinterest needs to redesign its recommendation infrastructure to power two primary surfaces: the 'Home Feed' (a pull-based experience) and 'Push Notifications' (a push-based experience). Both systems share a common pool of candidate content but serve users under very different latency and relevance constraints.
Requirements
- Functional:
- Home Feed: Provide a continuous, personalized stream of content based on user long-term interests and recent sessions.
- Push Notifications: Send timely, high-relevance alerts that minimize 'notification fatigue' while maximizing CTR.
- Non-Functional:
- Scale: Support 100M+ DAU with sub-200ms latency for feed generation.
- Freshness: Incorporate content interactions (e.g., saves, clicks) into the ranking models within minutes.
- Constraints:
- Notifications must be throttled per user to avoid churn.
- The system must account for 'cold-start' content and users.
Expectations
Design a system architecture that includes:
- Data Pipeline: How do you handle feature engineering for both batch and near-real-time signals?
- Candidate Generation & Ranking: How do you balance the trade-off between exploration (new content) and exploitation (known interests) in both surfaces?
- Notification Strategy: How do you decide when to send a notification versus relying on the user to check their feed?
- Evaluation: Define success metrics for both surfaces and how you would mitigate negative feedback loops (e.g., users silencing notifications).
Hints
Hint 1
Consider using a two-stage retrieval-ranking architecture: a coarse filter to select top candidates followed by a heavy-weight neural network for precise scoring.
Hint 2
Think about how the 'notification budget' can be managed using a secondary model that predicts the probability of a user reacting to an interruptive alert vs. ignoring it.
Hint 3
Address the feedback loop by incorporating 'negative signals' (e.g., clicking 'hide pin' or dismissing notifications) as explicit weights in the loss function.
Follow-up questions
- How would you adapt your ranking model if the distribution of content changes significantly due to a viral trend?
- How do you handle 'contextual bandits' in the notification system to improve exploration of what notification categories a user actually prefers?
- What specific infrastructure would you use to ensure that the user's feed is updated with their latest interaction immediately after they save a pin?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.