← Pinterest Interview Insights

Pinterest·Machine Learning Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
May 2026

Summary

Pinterest ML engineer interview focused entirely on designing a pin search system end to end. It was a dense session covering retrieval, ranking, loss functions, and experimentation, the kind of question where you can go pretty deep on any one piece and still feel like you barely scratched the surface.

Questions Asked (7)

Q1

Design a search engine for Pinterest pins, covering the full ML pipeline from candidate retrieval through ranking.

System DesignTechnical Trade-offs
Author's notes

This was basically the whole interview.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then walk through the multi-stage retrieval and ranking pipeline, explaining design choices and trade-offs at each stage. Emphasize how you would evaluate and iterate on the system, and how you'd handle Pinterest-specific challenges like visual search and cold-start.

Pro tip: Anchor your design in Pinterest's unique aspects: visual similarity, multimodal signals, and the home feed's mix of fresh and stale content. Show you understand that ranking is not just about relevance but also about diversity and business metrics.

1. Clarify Requirements and Scale

Ask about scale (number of pins, users, QPS), latency constraints, and key objectives (relevance, engagement, diversity). Confirm whether the search is text-based, visual, or multimodal.

2. Design Candidate Retrieval

Propose multiple retrieval sources: inverted index for text, embedding-based ANN for visual and semantic similarity, and graph-based for related pins. Discuss how to combine them and handle cold-start.

3. Design Ranking Pipeline

Outline a multi-stage ranking system: lightweight ranker to prune candidates, then a heavy ranker (e.g., deep neural network) for final scoring. Mention feature engineering, model architecture, and training data.

4. Address Evaluation and Iteration

Explain offline metrics (NDCG, recall@k) and online A/B testing. Discuss how to monitor and iterate, including handling feedback loops and bias.

5. Discuss Trade-offs and Scalability

Highlight trade-offs between latency and quality, model complexity, and infrastructure costs. Explain how to scale the system horizontally and handle real-time updates.

Key Points to Mention

  • Two-tower models for candidate retrieval and embedding-based ANN search
  • Multi-stage ranking with cascade architecture and model distillation
  • Feature engineering for user, pin, and context, including visual embeddings
  • Handling cold-start and exploration-exploitation in ranking
  • Evaluation metrics: offline (recall, NDCG) and online (CTR, saves, diversity)
  • Scalability considerations: sharding, caching, and real-time indexing

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you approach candidate generation for pin search, and what retrieval strategies would you consider?

System DesignTechnical Trade-offs
Author's notes

Covered two main paths: sparse retrieval via inverted index on pin metadata and title text, and dense retrieval using approximate nearest neighbor search over learned embeddings.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem scope and requirements, then outline a multi-stage retrieval system that balances recall and efficiency. Emphasize how you would leverage Pinterest's unique data (visual, textual, and engagement signals) and discuss trade-offs between different retrieval strategies.

Pro tip: Highlight the importance of evaluating candidate generation independently from ranking, using metrics like recall@k, and mention how you would handle cold-start and long-tail queries in a visually-driven platform like Pinterest.

1. Clarify Requirements and Constraints

Ask questions to understand the scale, latency requirements, and available data (e.g., query logs, image embeddings, user interactions). Confirm whether the focus is on text-based, visual, or multimodal search.

2. Design a Multi-Stage Retrieval Pipeline

Propose a two-stage approach: a fast candidate generation stage (e.g., using approximate nearest neighbor search on embeddings) followed by a more precise ranking stage. Explain how to combine multiple retrieval sources.

3. Select Retrieval Strategies

Discuss strategies such as lexical retrieval (BM25), semantic retrieval (dense embeddings), and visual retrieval (image embeddings). Consider hybrid approaches and how to fuse results (e.g., reciprocal rank fusion).

4. Address Scalability and Efficiency

Explain how to handle large-scale data using ANN indexes (e.g., FAISS, HNSW), sharding, and caching. Discuss latency vs. recall trade-offs and how to optimize for real-time serving.

5. Evaluate and Iterate

Describe offline evaluation metrics (recall@k, coverage) and online A/B testing. Mention how to incorporate user feedback and handle cold-start via content-based or hybrid methods.

Key Points to Mention

  • Multimodal retrieval: combining text, image, and engagement signals
  • Approximate nearest neighbor (ANN) techniques for scalable vector search
  • Hybrid retrieval: lexical + semantic + visual
  • Fusion methods like reciprocal rank fusion or learned fusion
  • Cold-start and long-tail query handling
  • Evaluation metrics: recall@k, coverage, and online metrics

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Walk me through how you'd design the ranking model, including architecture choices and input features.

System DesignAlgorithms & Data Structures
Author's notes

Went with a two-tower baseline first then discussed cross-encoders for reranking.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the ranking objective and constraints (e.g., engagement vs. relevance, latency, scale). Then propose a multi-stage architecture (candidate generation, ranking, re-ranking) and detail the model choice (e.g., two-tower for retrieval, deep & cross network for ranking) and input features (user, pin, context, cross features).

Pro tip: Emphasize the importance of feature freshness and real-time signals, and discuss how you'd handle cold-start and position bias—these are critical at Pinterest's scale.

1. Clarify Requirements

Ask about the ranking objective (e.g., clicks, saves, long-term engagement), scale (QPS, catalog size), latency constraints, and whether it's for home feed, related pins, or search.

2. Propose Multi-Stage Architecture

Outline a funnel: candidate generation (e.g., two-tower embeddings, ANN retrieval) to narrow millions to thousands, then a ranking model (e.g., deep neural network with wide & deep or DCN) to score hundreds, and finally a re-ranking layer for diversity and business rules.

3. Detail Ranking Model

Choose a model architecture (e.g., DNN with embeddings, or transformer for sequential user history) and justify it based on the need to capture non-linear interactions and sequential patterns.

4. List Input Features

Categorize features: user (demographics, long-term interests, real-time actions), pin (image embeddings, text, category, freshness), context (time, device, location), and cross features (user-pin affinity, co-engagement).

5. Discuss Training & Serving

Explain training setup (e.g., pointwise vs. pairwise loss, negative sampling), online serving (feature store, model serving latency), and evaluation metrics (offline AUC, online A/B tests).

Key Points to Mention

  • Two-tower model for candidate generation and deep ranking model for scoring
  • Feature engineering: user embeddings, pin embeddings, real-time features, cross features
  • Handling position bias and cold-start with techniques like position-aware training and content-based fallbacks
  • Use of sequential models (e.g., transformers) to capture user history
  • Latency and scalability considerations: ANN indexes, feature caching, model quantization
  • Evaluation: offline metrics (AUC, NDCG) and online A/B testing with engagement metrics

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

What loss functions would you use for training the ranking model, and how would you handle negative sampling?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Talked through pointwise cross-entropy versus pairwise approaches like BPR and triplet loss.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the ranking task (e.g., pointwise, pairwise, listwise) and the business objective (e.g., engagement, relevance). Then, discuss appropriate loss functions (e.g., logistic loss, pairwise hinge, softmax cross-entropy) and explain negative sampling strategies (e.g., uniform, popularity-based, hard negatives) with trade-offs. Emphasize how choices impact model performance and training efficiency.

Pro tip: At Pinterest, ranking often involves multiple objectives (e.g., clicks, saves, hides). Mentioning multi-task learning with a combined loss (e.g., weighted sum) and using hard negative mining from user interaction data can demonstrate practical maturity.

1. Clarify the ranking problem

Ask whether the task is pointwise, pairwise, or listwise, and what the final metric is (e.g., NDCG, CTR). This shows you tailor solutions to the problem.

2. Choose loss functions

For pointwise, use logistic or MSE; for pairwise, use hinge or BPR; for listwise, use softmax cross-entropy or LambdaRank. Explain why each fits the task.

3. Discuss negative sampling strategies

Cover uniform, popularity-based, and hard negative sampling. Explain how hard negatives (e.g., items user almost engaged with) can improve discrimination but risk overfitting.

4. Address trade-offs and implementation

Compare computational cost, bias, and effectiveness. Mention techniques like in-batch negatives, sampling with correction, and how to tune the number of negatives.

5. Connect to Pinterest context

Relate to Pinterest's use cases: visual search, home feed, ads. Highlight multi-task learning and how negative sampling can reflect user feedback (e.g., hides as negatives).

Key Points to Mention

  • Pointwise vs. pairwise vs. listwise loss functions and their suitability
  • Logistic loss, pairwise hinge, BPR, softmax cross-entropy, and LambdaRank
  • Negative sampling methods: uniform, popularity-based, hard negatives
  • In-batch negatives and sampling bias correction
  • Trade-offs: computational efficiency vs. model accuracy, risk of false negatives
  • Multi-task learning and combining losses for multiple engagement signals

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

Which offline metrics would you use to evaluate the search ranking model before deploying?

Product Analytics & MetricsA/B Testing & Experimentation
Author's notes

NDCG, Recall@K, MRR.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the goal of the search ranking model (e.g., relevance, engagement) and the offline data available. Then, structure your answer around three types of metrics: ranking quality, business impact, and user behavior, emphasizing how they complement each other and predict online performance.

Pro tip: Mention that offline metrics are proxies and should be validated with online A/B tests, but highlight the importance of choosing metrics that align with Pinterest's visual discovery and engagement goals, such as saves and closeups.

1. Clarify the objective and constraints

Ask clarifying questions to understand the model's purpose (e.g., improving relevance, engagement) and the offline data available (e.g., click logs, human judgments). This ensures your metrics align with business goals.

2. Select ranking quality metrics

Choose metrics that evaluate the order of results, such as NDCG, MAP, MRR, and Precision@k. These measure how well the model ranks relevant items higher.

3. Include business and user engagement metrics

Incorporate metrics like click-through rate (CTR), save rate, and closeup rate, which reflect user actions and are directly tied to Pinterest's success. These can be computed offline using logged data.

4. Consider diversity and coverage metrics

Evaluate the diversity of results (e.g., intra-list similarity) and catalog coverage to ensure the model doesn't overly focus on popular items, which is crucial for a discovery platform like Pinterest.

5. Validate with online experiments

Acknowledge that offline metrics are proxies and should be validated with online A/B tests. Suggest a plan to monitor key online metrics and iterate.

Key Points to Mention

  • NDCG (Normalized Discounted Cumulative Gain) for ranking quality
  • MAP (Mean Average Precision) and MRR (Mean Reciprocal Rank)
  • Precision@k and Recall@k for top-k results
  • Business metrics like CTR, save rate, and closeup rate
  • Diversity and coverage metrics to avoid popularity bias
  • The importance of aligning offline metrics with online A/B test results

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q6

How would you approach feature engineering for pin search, particularly for image and user behavior signals?

System DesignProduct Analytics & Metrics
Author's notes

Talked about CNN and ViT embeddings for images, text features from pin descriptions and board names, engagement history, and freshness signals.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem: pin search must balance relevance, engagement, and freshness. Then describe a multi-modal feature engineering pipeline that extracts visual embeddings from pin images and behavioral signals from user interactions, and explain how to combine them into a unified ranking model while addressing scalability and cold-start challenges.

Pro tip: Emphasize that feature engineering is iterative and must be validated with online metrics like CTR and saves; mention that you'd start with a strong baseline using pre-trained embeddings and simple aggregates before moving to complex models.

1. Understand the problem and data

Clarify the goal of pin search (e.g., relevance, engagement) and identify available data sources: pin images, text metadata, user interaction logs, and query logs. Consider constraints like latency and scale.

2. Image feature engineering

Extract visual features using pre-trained CNN or transformer models (e.g., ResNet, CLIP) to get embeddings. Optionally fine-tune on Pinterest data. Also consider object detection or color histograms for interpretability.

3. User behavior feature engineering

Aggregate user interactions (clicks, saves, hides) over time windows to create features like CTR, save rate, and recency-weighted counts. Incorporate sequence models (e.g., RNNs, transformers) to capture session-based intent.

4. Combine and select features

Fuse image and behavior features via concatenation, attention, or a two-tower model. Perform feature selection and dimensionality reduction to avoid overfitting and reduce latency.

5. Evaluate and iterate

Offline evaluate with ranking metrics (NDCG, MRR) and online A/B test. Monitor for bias, cold-start, and feedback loops. Iterate by adding new signals or refining representations.

Key Points to Mention

  • Use of pre-trained visual embeddings (e.g., CLIP, ResNet) for image features
  • Behavioral signals: clicks, saves, hides, dwell time, and their temporal aggregations
  • Handling cold-start for new pins and users via content-based features
  • Scalability: efficient feature storage and serving (e.g., feature stores, ANN indexes)
  • Multi-modal fusion techniques: early vs. late fusion, attention mechanisms
  • Evaluation metrics: offline (NDCG) and online (CTR, saves, search success rate)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q7

How would you set up online evaluation and A/B testing for changes to the search ranking system?

A/B Testing & ExperimentationProduct Analytics & Metrics
Author's notes

Standard A/B setup, talked about randomizing at the user level, choosing guardrail metrics alongside primary metrics like CTR and save rate.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining clear success metrics that align with Pinterest's business goals, such as engagement and relevance. Then outline a robust experimental design including randomization, control/treatment setup, and statistical analysis. Finally, discuss how to iterate based on results and handle potential pitfalls like novelty effects and network effects.

Pro tip: Emphasize the importance of guardrail metrics to ensure that short-term gains don't harm long-term user experience, and mention the need for interleaving experiments to quickly compare multiple ranking algorithms.

1. Define Objectives and Metrics

Identify the primary goal of the ranking change (e.g., increase engagement, improve relevance) and select corresponding success metrics (e.g., CTR, saves, time spent). Also define guardrail metrics to monitor for negative side effects.

2. Design the Experiment

Determine the randomization unit (e.g., user, session), sample size, and duration. Set up control and treatment groups, ensuring proper isolation and avoiding contamination. Consider using interleaving for faster iteration.

3. Implement and Monitor

Deploy the experiment using an A/B testing platform, ensuring logging and data collection are accurate. Monitor for technical issues and early signals of significant effects or guardrail violations.

4. Analyze Results

Apply statistical tests (e.g., t-test, bootstrapping) to compare metrics between groups. Check for novelty effects, seasonality, and segment-level impacts. Use sequential testing if peeking at results.

5. Decide and Iterate

Based on results, decide whether to launch, iterate, or abandon the change. Document learnings and plan follow-up experiments to refine the ranking system.

Key Points to Mention

  • Randomization unit and sample size calculation
  • Choice of primary and guardrail metrics
  • Handling network effects and interference in social platforms
  • Use of interleaving for ranking evaluation
  • Statistical significance and confidence intervals
  • Novelty and primacy effects in long-term experiments

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.