← Snapchat Interview Insights

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

SeniorPrefer not to say
May 2026

Summary

ML system design round at Snapchat for an MLE role, focused entirely on building a lens recommendation system for a social camera app. Pretty deep dive, they pushed hard on the ML platform side which I wasn't fully prepared for.

Questions Asked (8)

Q1

Design a recommendation system for augmented-reality lenses in a social camera application, covering product goals, candidate generation, ranking, training data, and online serving.

System DesignProduct Sense & IdeationTechnical Trade-offs
Author's notes

This was the main question and it ate up most of the session.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the product goals and success metrics for AR lens recommendations, then walk through the ML system design in a logical flow: candidate generation, ranking, training data, and online serving. Emphasize trade-offs between relevance, diversity, and latency, and tie technical choices back to user engagement and business impact.

Pro tip: Anchor your answer in Snapchat's unique AR ecosystem—lenses are creative, ephemeral, and socially driven—so highlight how you'd leverage signals like friend usage, camera context, and trending lenses to drive recommendations. Also, proactively discuss cold-start and freshness, since new lenses are constantly added.

1. Clarify Product Goals and Metrics

Define what success means: e.g., increase lens usage, retention, or sharing. Identify key metrics like CTR, lens apply rate, and session length, and consider constraints like latency and diversity.

2. Design Candidate Generation

Outline multiple sources: collaborative filtering (user-user, item-item), content-based (visual features, tags), trending/popular, and social graph (friends' usage). Ensure a manageable candidate set for ranking.

3. Develop Ranking Model

Choose a model (e.g., two-tower or gradient-boosted trees) to score candidates. Incorporate features like user history, lens metadata, context (time, location), and social signals. Optimize for multiple objectives (engagement, diversity).

4. Plan Training Data and Pipeline

Describe data collection: implicit feedback (views, applies, shares) and explicit (likes). Address negative sampling, label definition, and handling biases. Discuss offline evaluation and online A/B testing.

5. Architect Online Serving

Explain the serving flow: retrieve candidates, rank in real-time, apply business rules (e.g., diversity, freshness), and return top-K. Discuss latency requirements, caching, and fallback strategies.

Key Points to Mention

  • Two-stage architecture: candidate generation + ranking to balance scalability and relevance.
  • Feature engineering: user demographics, historical interactions, lens visual features, social graph, and contextual signals (time, location, camera mode).
  • Cold-start solutions: content-based features, explore-exploit, and leveraging social connections for new lenses.
  • Evaluation metrics: offline (AUC, NDCG) and online (CTR, apply rate, retention), with A/B testing framework.
  • Latency and scalability: approximate nearest neighbor for retrieval, model quantization, and caching for real-time serving.
  • Diversity and freshness: avoid filter bubbles, promote new/trending lenses, and incorporate business rules in post-ranking.

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

Q2

How would you handle cold start for both new lenses and new users?

Product Analytics & MetricsTechnical Trade-offsSystem Design
Author's notes

Actually felt okay about this one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that cold start is a classic exploration-exploitation trade-off, and that the solution depends on the type of cold start (new lens vs. new user) and the available data. Then outline a multi-pronged strategy: for new lenses, leverage content-based features and contextual bandits; for new users, use demographic/contextual signals and rapid online learning. Finally, discuss how to measure success and iterate.

Pro tip: Emphasize that cold start is not a one-time problem but an ongoing process—new lenses and users arrive continuously, so you need a system that adapts quickly and balances exploration with exploitation. Also, mention that at Snapchat, the cost of a bad recommendation is low (a swipe), so you can afford more exploration than in other domains.

1. Clarify the problem and constraints

Define what 'cold start' means for new lenses (no interaction data) and new users (no historical behavior). Ask about the scale, latency requirements, and available signals (e.g., lens metadata, user demographics, context).

2. Leverage content and context for new lenses

Use lens metadata (e.g., category, visual features, creator) to compute content-based similarities and recommend to users with matching preferences. Combine with contextual bandits to explore new lenses efficiently.

3. Use contextual signals and rapid adaptation for new users

For new users, rely on demographics, device, time, and location to make initial recommendations. Employ online learning (e.g., Thompson sampling) to quickly update preferences from early interactions.

4. Design a unified exploration strategy

Integrate both cases into a single system that balances exploration and exploitation, e.g., using a multi-armed bandit framework with features from both lenses and users. Ensure the system can handle both cold-start scenarios simultaneously.

5. Measure and iterate

Define metrics (e.g., engagement, retention, diversity) and set up A/B tests to evaluate the cold-start strategy. Monitor performance and adjust exploration rates based on feedback.

Key Points to Mention

  • Content-based filtering using lens metadata (e.g., visual embeddings, tags) to address new lens cold start.
  • Contextual bandits (e.g., LinUCB, Thompson sampling) for balancing exploration and exploitation.
  • User-side cold start: leveraging demographics, device, and contextual signals; rapid online learning from early interactions.
  • Hybrid approach: combining content-based and collaborative filtering, with fallback to popularity or trending lenses.
  • Evaluation metrics: click-through rate, engagement time, retention, and diversity of recommendations.
  • Scalability and latency considerations for real-time recommendation at Snapchat's scale.

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

Q3

How would you use weighted logistic regression when different engagement actions like opens, creations, shares, and saves have different levels of value?

Technical Trade-offsProduct Analytics & MetricsSystem Design
Author's notes

I knew this conceptually but explaining it cleanly under pressure was harder than expected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining that weighted logistic regression addresses the problem of varying action values by assigning weights to each sample based on the value of the observed action. Then, walk through how you would define the weights (e.g., using business value or engagement depth), train the model, and evaluate its performance, emphasizing the trade-offs and practical considerations.

Pro tip: Mention that weights should be normalized to keep the effective sample size stable and to avoid numerical issues, and that you should validate the weighting scheme with offline metrics and online A/B tests to ensure it aligns with business goals.

1. Define the objective and action values

Clarify the prediction goal (e.g., probability of a valuable engagement) and assign a numerical value to each action (open, creation, share, save) based on business impact or user engagement depth.

2. Incorporate weights into logistic regression

Use weighted logistic regression where each sample's contribution to the loss is scaled by the value of its observed action. This can be done by passing sample weights to the model during training.

3. Address practical considerations

Normalize weights to prevent numerical instability, consider class imbalance, and ensure the weighting scheme doesn't overly bias the model. Discuss potential alternatives like multi-task learning or ordinal regression.

4. Evaluate and iterate

Evaluate the model using weighted metrics (e.g., weighted log-loss, AUC) and validate with online experiments. Iterate on the action values based on business outcomes.

Key Points to Mention

  • Weighted logistic regression modifies the loss function to account for sample importance, effectively treating each action as having a different cost of misclassification.
  • Action values can be derived from business metrics (e.g., revenue, time spent) or learned from data (e.g., using inverse propensity scoring).
  • Normalization of weights (e.g., scaling to mean 1) helps maintain effective sample size and interpretability of coefficients.
  • Trade-offs: weighting can improve alignment with business goals but may reduce model calibration and increase variance; consider using regularization.
  • Alternatives: multi-task learning to predict each action separately, or using a ranking approach if the goal is to rank actions by value.
  • Evaluation should include both offline weighted metrics and online A/B testing to ensure the weighted model improves key business metrics.

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

Q4

Describe what a feature store schema would look like for this system.

System DesignData Modeling
Author's notes

Blanked for a second.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the ML use case and system requirements, then outline the core entities and their relationships in the feature store schema. Focus on how the schema supports both offline training and online serving, ensuring consistency and scalability.

Pro tip: Emphasize the importance of point-in-time correctness and how your schema design prevents data leakage, which is critical for production ML systems.

1. Clarify Requirements

Ask questions to understand the ML use case, data sources, latency requirements, and scale. This ensures the schema design is tailored to the specific system.

2. Identify Core Entities

Define the main entities such as user, content, and context, and their relationships. This forms the foundation of the feature store schema.

3. Design Feature Tables

Propose tables for feature groups, features, and feature values, including metadata like timestamps and versioning. Consider both batch and streaming features.

4. Address Offline/Online Consistency

Explain how the schema supports point-in-time correct joins for training and low-latency lookups for serving, possibly using a dual-store architecture.

5. Discuss Scalability and Governance

Mention partitioning, indexing, and access control to handle Snapchat-scale data and ensure feature discoverability and reuse.

Key Points to Mention

  • Entity-centric design with primary keys like user_id and content_id
  • Feature metadata: name, type, description, owner, version, and freshness
  • Time-travel and point-in-time correctness for offline training
  • Online serving with low-latency key-value stores (e.g., Redis, Bigtable)
  • Data partitioning and indexing strategies for scalability
  • Integration with existing data infrastructure (e.g., Kafka, Spark, BigQuery)

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

Q5

How would you correct for position bias in the training data?

A/B Testing & ExperimentationTechnical Trade-offs
Author's notes

Inverse propensity scoring was the answer they were looking for and I got there, but I initially started talking about randomization which is more of a data collection fix than a training fix.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining position bias and its impact on ranking models, then outline a systematic approach to detect and correct it. Emphasize the importance of unbiased evaluation and the trade-offs between different correction methods, especially in the context of Snapchat's large-scale recommendation systems.

Pro tip: Mention that position bias correction should be validated through online A/B tests, as offline metrics can be misleading. Also, highlight the need to balance bias correction with model performance and latency constraints.

1. Define and Detect Position Bias

Explain what position bias is and how it manifests in training data (e.g., items at higher positions get more clicks regardless of relevance). Describe methods to detect it, such as examining click-through rates by position or using randomization.

2. Choose a Correction Method

Discuss common techniques like inverse propensity scoring (IPS), position-based models, or adding position as a feature during training but removing it at inference. Highlight the trade-offs: IPS can be high variance, while position as a feature may not fully remove bias.

3. Implement and Train

Detail how to implement the chosen method, such as estimating propensities from randomization or using a separate model to predict position bias. Emphasize the need for careful feature engineering and validation to avoid introducing new biases.

4. Evaluate Offline and Online

Stress the importance of evaluating the corrected model offline using unbiased metrics (e.g., from a holdout set with randomized positions) and then validating online via A/B tests. Mention that online metrics like engagement and satisfaction are ultimate judges.

5. Monitor and Iterate

Explain that bias correction is an ongoing process. Set up monitoring to detect drift in position bias and be prepared to retrain or adjust the correction method as user behavior or the system evolves.

Key Points to Mention

  • Inverse Propensity Scoring (IPS) and its variants (e.g., clipped IPS, self-normalized IPS)
  • Position as a feature during training but not at inference (positional features)
  • Randomization or exploration to collect unbiased data (e.g., epsilon-greedy)
  • Evaluation metrics: offline (e.g., IPS-weighted metrics) and online (A/B tests)
  • Trade-offs: bias-variance, computational cost, and impact on latency
  • Snapchat's specific context: large-scale, mobile, ephemeral content, and ranking in Discover/Stories

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

Q6

How would you prevent the system from overexposing only the most popular lenses?

Product StrategyTechnical Trade-offsProduct Sense & Ideation
Author's notes

Talked about diversity constraints in post-processing, exploration budgets, and down-weighting popularity signals in the ranking model.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying what 'overexposing' means in Snapchat's context—likely the lens recommendation system disproportionately surfacing popular lenses, reducing diversity and discovery. Then propose a multi-pronged strategy: adjust ranking objectives to include diversity and fairness, implement exploration mechanisms, and monitor long-term ecosystem health. Emphasize trade-offs between short-term engagement and long-term user satisfaction and creator fairness.

Pro tip: Frame the solution around Snapchat's unique AR ecosystem: balance user engagement with creator opportunity and content freshness, and mention how you'd measure success beyond CTR, such as diversity metrics and creator retention.

1. Define the problem and metrics

Clarify what 'overexposing' means: is it about popularity bias in recommendations, lack of diversity, or creator fairness? Define success metrics like exposure diversity, creator coverage, and long-term user retention.

2. Diagnose the root cause

Identify why popular lenses dominate: feedback loops in ranking, lack of exploration, or objective misalignment. Consider data biases and system incentives.

3. Design interventions

Propose algorithmic changes: diversity-aware ranking, exploration-exploitation (e.g., epsilon-greedy, Thompson sampling), re-ranking with fairness constraints, or multi-objective optimization. Also consider product levers like curated collections or personalized discovery.

4. Evaluate trade-offs and iterate

Discuss potential impacts on engagement, user satisfaction, and creator ecosystem. Suggest A/B testing and long-term monitoring to balance competing objectives.

Key Points to Mention

  • Popularity bias and feedback loops in recommendation systems
  • Exploration vs. exploitation techniques (e.g., bandits, randomization)
  • Diversity and fairness metrics (e.g., Gini coefficient, coverage, entropy)
  • Multi-objective optimization balancing engagement, diversity, and freshness
  • Long-term ecosystem health: creator retention and content variety
  • A/B testing and counterfactual evaluation to measure intervention impact

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

Q7

What should a machine learning platform include to support reproducibility and consistent feature usage between offline training and online serving?

System DesignTechnical Trade-offsData Modeling
Author's notes

Covered feature store, model registry, versioned training specs, and lineage tracking.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining reproducibility and feature consistency as core requirements, then outline the key components of an ML platform that address them: feature store, versioning, lineage, and monitoring. Emphasize how these components work together to ensure identical feature computation offline and online, and discuss trade-offs like latency vs. consistency.

Pro tip: Highlight the importance of a feature store with a unified transformation API and point-in-time correctness to prevent training-serving skew. Mention that at scale, you'd also need to handle schema evolution and backfill strategies without breaking online serving.

1. Define Requirements

Clarify what reproducibility and consistency mean: same code, data, and environment produce same results; features computed identically offline and online. Mention the need for auditability and debugging.

2. Core Components

List essential platform components: feature store (offline/online), model registry, experiment tracking, data versioning, and orchestration. Explain how each supports reproducibility and consistency.

3. Feature Store Deep Dive

Detail the feature store's role: unified transformation logic (e.g., using a DSL or shared library), point-in-time correct joins for training, low-latency serving for online, and materialization pipelines.

4. Versioning and Lineage

Explain versioning of data, features, models, and code, plus lineage tracking to trace from model predictions back to raw data. This ensures reproducibility and facilitates debugging.

5. Monitoring and Validation

Discuss monitoring for feature drift, skew detection, and data quality. Include automated validation to catch inconsistencies between offline and online features.

Key Points to Mention

  • Feature store with offline/online parity and point-in-time correctness
  • Versioning of data, features, models, and code (e.g., Git, DVC, MLflow)
  • Lineage tracking and metadata management for auditability
  • Consistent transformation logic (e.g., shared code or DSL) between training and serving
  • Monitoring for training-serving skew and feature drift
  • Trade-offs: latency vs. consistency, cost of maintaining dual storage, and backfill strategies

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

Q8

What clarifying questions would you ask before starting the design, and what assumptions would you make if answers weren't available?

Adaptability & AmbiguityProduct Sense & Ideation
Author's notes

Asked about the surface being ranked, latency budget, and whether lenses were user-generated or curated.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem as an ML design task, then list clarifying questions across key dimensions like product goals, data, constraints, and success metrics. For each area, state a reasonable assumption you'd make if answers aren't available, and explain how that assumption de-risks the project.

Pro tip: Prioritize questions that directly impact model architecture or data requirements, and explicitly tie each assumption to a fallback plan—this shows you can move forward without blocking on perfect information.

1. Clarify the product goal and user impact

Ask what user problem the model solves, how it integrates into Snapchat, and what success looks like (e.g., engagement, retention). Assume a specific goal like increasing story views if unspecified.

2. Understand data availability and quality

Ask about data sources, volume, labeling, and privacy constraints. Assume you have access to historical user interaction logs with implicit feedback if not specified.

3. Identify technical and business constraints

Ask about latency, compute budget, model size, and deployment environment (on-device vs. server). Assume server-side inference with <100ms latency for a feed ranking model.

4. Define evaluation metrics and fallback

Ask how success will be measured (offline and online) and what baseline exists. Assume you'll use AUC for offline and A/B test on CTR/engagement, with a simple heuristic as baseline.

5. State assumptions and plan to validate

Summarize your assumptions, note which are riskiest, and describe how you'd validate them early (e.g., small-scale experiment, data audit).

Key Points to Mention

  • Product context: how the model fits into Snapchat's features (e.g., Discover, Stories, Ads)
  • Data: availability of labeled data, user privacy, and potential biases
  • Constraints: latency, compute, model interpretability, and on-device vs. cloud
  • Metrics: offline metrics (AUC, precision@k) and online metrics (CTR, watch time, retention)
  • Assumptions: explicit fallbacks (e.g., use pre-trained embeddings, start with simple model)
  • Validation: how to test assumptions quickly (e.g., pilot with small traffic, shadow mode)

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