← TikTok Interview Insights

TikTok·Data Scientist·Onsite - System Design / Architecture·Senior

Senior
May 2026

Summary

TikTok DS interview that was basically one massive system design question about ad selection. The scope was enormous and I felt like I was just barely keeping up the whole time.

Questions Asked (6)

Q1

Design an end-to-end ad selection system for TikTok that chooses among three advertiser types (gaming/CPI, e-commerce/CPA, branding/CPM) at impression time to maximize expected advertiser value while respecting budgets and pacing.

System DesignTechnical Trade-offsPricing & Monetization
Author's notes

This was the whole interview, basically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the objective: maximize total expected advertiser value subject to budget and pacing constraints, then outline a two-stage system: candidate generation (retrieval) and ranking with a unified value-based auction. For ranking, propose a model that predicts expected value per impression for each ad, incorporating pCTR, pCVR, and bid, then apply a pacing and budget allocation layer to ensure fairness and delivery. Finally, discuss trade-offs between different advertiser types and how to handle cold-start and exploration.

Pro tip: Emphasize that the system should be evaluated not just on short-term revenue but also on long-term advertiser satisfaction and platform health, and mention the importance of calibrating predictions across advertiser types to avoid bias in the auction.

1. Clarify Objectives and Constraints

Define the goal: maximize expected value (e.g., revenue or advertiser ROI) while respecting budgets and pacing. Identify constraints like budget limits, pacing goals, and fairness across advertiser types.

2. Design Candidate Generation

Retrieve a set of eligible ads for each impression based on targeting, budget availability, and pacing status. Use efficient indexing and filtering to reduce the candidate set.

3. Build Ranking and Value Prediction Models

For each candidate, predict expected value using models for pCTR, pCVR, and bid (or CPM). Combine into a single expected value score, ensuring calibration across advertiser types.

4. Implement Budget Pacing and Allocation

Apply pacing algorithms (e.g., probabilistic throttling or budget smoothing) to ensure even delivery and prevent overspend. Allocate budgets dynamically based on performance and remaining time.

5. Conduct Auction and Feedback Loop

Run a unified auction (e.g., second-price or VCG) using the expected value scores, and continuously update models and pacing parameters based on real-time feedback and A/B tests.

Key Points to Mention

  • Unified value-based auction that normalizes different advertiser types (CPI, CPA, CPM) into expected value per impression.
  • Prediction models: pCTR, pCVR, and bid prediction, with calibration to avoid systematic bias.
  • Budget pacing techniques: probabilistic throttling, budget smoothing, and pacing multipliers.
  • Trade-offs between exploration (to learn new ads) and exploitation (to maximize short-term value).
  • Handling cold-start for new advertisers and ads via contextual bandits or meta-learning.
  • Evaluation metrics: revenue, advertiser ROI, budget utilization, and pacing accuracy.

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

Q2

What features and models would you use to estimate P(install | ad, user, context) and P(purchase | ad, user, context), and how would you calibrate these for auction-time use?

System DesignData ModelingTechnical Trade-offs
Author's notes

Talked through user-side features, ad creative embeddings, contextual signals.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem as a multi-task learning challenge where you predict two related probabilities (install and purchase) from ad, user, and context features. Discuss model choices (e.g., deep neural networks with shared embeddings) and emphasize the need for calibration to align predicted probabilities with actual auction-time outcomes. Conclude with trade-offs between model complexity, latency, and calibration methods.

Pro tip: Highlight the importance of using field-aware factorization machines or deep learning models that can capture feature interactions, and mention that calibration should be done on a recent time window to account for temporal shifts in user behavior.

1. Feature Engineering

Identify and engineer features from ad (creative, bid, landing page), user (demographics, past behavior, embeddings), and context (time, device, placement). Consider cross features and embeddings for high-cardinality IDs.

2. Model Selection

Choose models that handle sparse, high-dimensional data and capture interactions, such as Deep & Cross Networks, Wide & Deep, or multi-task learning architectures with shared bottom layers and task-specific towers.

3. Multi-Task Learning

Jointly train the two tasks to leverage shared representations and improve generalization, especially for the sparser purchase signal. Use techniques like uncertainty weighting or gradient normalization to balance tasks.

4. Calibration

Apply post-hoc calibration methods like Platt scaling or isotonic regression on a holdout set to adjust predicted probabilities. For auction-time, ensure calibration is done on recent data and consider online calibration if distribution shifts.

5. Auction-Time Considerations

Optimize for low latency by using efficient model serving (e.g., TensorFlow Serving) and consider model distillation or quantization. Monitor calibration drift and retrain frequently.

Key Points to Mention

  • Use of embeddings for high-cardinality categorical features (user IDs, ad IDs).
  • Multi-task learning to share information between install and purchase predictions.
  • Calibration techniques: Platt scaling, isotonic regression, and their trade-offs.
  • Handling delayed feedback for purchase events (e.g., using survival analysis or delayed feedback models).
  • Latency constraints at auction time and model serving optimizations.
  • Evaluation metrics: LogLoss, AUC, and calibration plots (reliability diagrams).

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

Q3

How do you make scores from different ad objectives comparable at auction time, and what quality thresholds or user experience constraints would you apply?

Pricing & MonetizationProduct StrategyTechnical Trade-offs
Author's notes

Expected value per impression is the right frame and I got there, but I initially over-complicated it by trying to account for predicted win rate before I'd even set up the baseline.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining the need to normalize scores from different ad objectives into a common utility metric, such as expected value or predicted engagement, to enable fair auction comparisons. Then discuss the quality thresholds and user experience constraints you would implement, balancing monetization with long-term user satisfaction. Emphasize a data-driven approach with continuous monitoring and iteration.

Pro tip: Highlight the importance of calibrating predictions across objectives and using techniques like counterfactual estimation to avoid bias. Mention that thresholds should be dynamic and based on real-time user feedback to prevent ad fatigue.

1. Define a common utility metric

Choose a metric that captures the value of each objective to the platform, such as expected revenue or predicted user engagement, and convert all objective-specific scores into this metric.

2. Normalize and calibrate scores

Apply normalization techniques (e.g., min-max scaling, z-score) and calibrate predictions to ensure scores are comparable across objectives, using historical data and A/B tests.

3. Set quality thresholds

Establish minimum quality thresholds for ads (e.g., predicted click-through rate, relevance score) to filter out low-quality ads that could harm user experience.

4. Incorporate user experience constraints

Define constraints such as ad load limits, frequency caps, and diversity requirements to prevent user fatigue and maintain a positive experience.

5. Monitor and iterate

Continuously monitor auction outcomes, user feedback, and business metrics, and adjust thresholds and normalization methods as needed to optimize the trade-off.

Key Points to Mention

  • Expected value calculation and utility theory for comparing objectives
  • Calibration techniques like Platt scaling or isotonic regression
  • Quality thresholds based on predicted CTR, conversion rate, or relevance
  • User experience constraints: ad load, frequency capping, diversity
  • A/B testing and multi-armed bandits for threshold optimization
  • Long-term value vs. short-term revenue trade-offs

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

Q4

How would you handle exploration vs. exploitation in this ad system, including cold-start for new advertisers and guardrails like frequency capping and fairness?

System DesignA/B Testing & ExperimentationAdaptability & Ambiguity
Author's notes

Contextual bandits felt like the right answer and I said so.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the exploration-exploitation trade-off as a core challenge in ad ranking, then propose a multi-armed bandit or reinforcement learning approach with contextual features. Address cold-start via forced exploration or meta-learning, and integrate guardrails like frequency capping and fairness as constraints in the optimization objective.

Pro tip: Emphasize that guardrails should be enforced during exploration, not just exploitation, and that fairness metrics must be monitored continuously with automated alerts to prevent long-term bias.

1. Define the problem and objectives

Clarify the goals: maximize long-term revenue/user engagement while ensuring new advertisers get fair exposure and user experience is protected. Identify key metrics like CTR, conversion rate, and fairness metrics.

2. Choose an exploration-exploitation strategy

Propose a contextual bandit approach (e.g., Thompson Sampling or UCB) that balances exploration and exploitation based on advertiser and user features. Discuss how to incorporate cold-start by initializing priors or using meta-learning.

3. Design cold-start handling for new advertisers

Suggest techniques like forced exploration with a minimum impression quota, using side information (e.g., advertiser category, creative quality) to inform priors, or employing a separate exploration model for new advertisers.

4. Integrate guardrails (frequency capping, fairness)

Explain how to enforce frequency capping as a hard constraint in the bandit algorithm (e.g., by filtering eligible ads). For fairness, define metrics (e.g., demographic parity, equal opportunity) and incorporate them as constraints or via regularization in the reward function.

5. Evaluate and iterate with A/B testing

Describe how to set up A/B tests to measure the impact of the exploration strategy and guardrails on key metrics. Discuss potential pitfalls like delayed feedback and long-term effects, and suggest using counterfactual evaluation or interleaving.

Key Points to Mention

  • Contextual bandits (e.g., LinUCB, Thompson Sampling) for balancing exploration and exploitation
  • Cold-start solutions: forced exploration, meta-learning, or using side information to initialize priors
  • Frequency capping as a constraint: filter ads that exceed cap before ranking
  • Fairness metrics: demographic parity, equal opportunity, and how to incorporate them as constraints or penalties
  • A/B testing and counterfactual evaluation for measuring long-term impact
  • Handling delayed feedback and non-stationarity in ad systems

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

Q5

Walk through the auction mechanics you'd use, including bid shading, pacing control, and how multi-objective bidding interacts with second-price or VCG auctions.

Pricing & MonetizationSystem DesignTechnical Trade-offs
Author's notes

Second-price vs VCG I could talk about reasonably well.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the auction as a constrained optimization problem where you balance revenue, advertiser value, and user experience. Then walk through the mechanics: bid shading to avoid overpaying, pacing to smooth delivery, and how multi-objective bidding changes the game in second-price or VCG auctions. Emphasize trade-offs and practical implementation challenges.

Pro tip: Show you understand that in practice, auctions are not purely theoretical—real-world constraints like budget pacing, latency, and advertiser ROI often force deviations from optimal mechanisms. Mentioning A/B testing or simulation to validate changes demonstrates maturity.

1. Define objectives and constraints

Clarify the goals: maximize platform revenue, advertiser ROI, and user engagement while respecting budgets and pacing. Highlight that multi-objective bidding means advertisers value multiple outcomes (e.g., clicks, conversions, video views).

2. Explain bid shading

Describe bid shading as shading bids below true value to avoid winner's curse in first-price auctions, but note that in second-price or VCG, shading is theoretically unnecessary if bidding truthfully. Discuss how multi-objective bidding complicates shading because value is multidimensional.

3. Detail pacing control

Explain pacing as throttling ad delivery to spend budget evenly or meet performance goals. Mention techniques like probabilistic throttling or budget pacing algorithms, and how pacing interacts with auction dynamics (e.g., bid modification).

4. Analyze multi-objective bidding in second-price/VCG

Discuss how in second-price auctions, truthful bidding is dominant for single-objective, but with multiple objectives, advertisers may strategically misreport. In VCG, truthful bidding is incentive-compatible for single-objective, but multi-objective can break this if objectives are not separable.

5. Address practical trade-offs and implementation

Talk about real-world challenges: latency, data sparsity, and the need for machine learning to predict click-through rates. Suggest simulations or A/B tests to evaluate auction changes, and mention TikTok's specific context (e.g., short video ads, engagement metrics).

Key Points to Mention

  • Bid shading: shading bids in first-price auctions to maximize utility; not needed in second-price if truthful, but multi-objective may require strategic shading.
  • Pacing control: algorithms like budget pacing, throttling, and bid modification to meet spend targets and performance goals.
  • Multi-objective bidding: advertisers value multiple outcomes (e.g., clicks, conversions, views); this complicates bidding strategies and auction design.
  • Second-price auction: truthful bidding is dominant for single-objective; multi-objective may lead to non-truthful bidding.
  • VCG auction: truthful bidding is incentive-compatible for single-objective; multi-objective can break incentive compatibility if objectives are not separable.
  • Practical considerations: latency, data sparsity, ML for prediction, A/B testing, and TikTok's specific ad formats and metrics.

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

Q6

How would you evaluate this system offline and online, detect feedback loops, and measure success beyond short-term revenue metrics like incremental ROAS and long-term engagement?

A/B Testing & ExperimentationProduct Analytics & MetricsSystem Design
Author's notes

Counterfactual replay and lift tests I covered.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by outlining a layered evaluation framework that combines offline metrics (e.g., AUC, calibration, counterfactual estimates) with online A/B tests, while explicitly addressing feedback loops through techniques like interleaving, holdout groups, and causal inference. Then propose a balanced metric suite that goes beyond short-term ROAS to include long-term engagement, retention, and ecosystem health, and explain how to measure them via long-horizon experiments and quasi-experimental methods.

Pro tip: Emphasize that at TikTok, feedback loops are not just a risk but a core part of the system—so you need to design experiments that account for them from the start, e.g., by using a small random holdout that never gets exposed to the new policy to measure long-term effects. Also, mention that you would align metrics with TikTok's 'user well-being' and 'ecosystem health' goals, not just revenue.

1. Define offline evaluation metrics and methods

Use historical data to compute ranking metrics (NDCG, recall@k), calibration, and counterfactual estimators (IPS, doubly robust) to predict online performance. Validate with a small-scale online shadow test.

2. Design online experiments with feedback loop safeguards

Run A/B tests with a long-term holdout group that never receives the treatment, and use switchback or interleaving designs to mitigate interference and feedback loops. Monitor for novelty effects and carryover.

3. Measure long-term and ecosystem metrics

Track retention, DAU/MAU, session time, and creator diversity over weeks/months. Use causal inference methods (e.g., synthetic control, difference-in-differences) when randomization is not possible.

4. Detect and quantify feedback loops

Analyze how model predictions influence user behavior, which then becomes training data. Use techniques like inverse propensity scoring, exploration bonuses, or reinforcement learning with off-policy evaluation to break loops.

5. Synthesize into a decision framework

Combine offline and online evidence, weigh short-term vs. long-term trade-offs, and recommend a rollout strategy with continuous monitoring and guardrail metrics.

Key Points to Mention

  • Offline metrics: AUC, NDCG, calibration, counterfactual evaluation (IPS, doubly robust).
  • Online experimentation: A/B tests, switchback, interleaving, long-term holdout groups.
  • Feedback loops: how predictions affect user behavior and future data; mitigation via exploration, randomization, and causal inference.
  • Long-term metrics: retention, DAU/MAU, session time, creator diversity, user well-being surveys.
  • Causal inference methods: difference-in-differences, synthetic control, instrumental variables.
  • Guardrail metrics: ensure no harm to user experience or ecosystem health.

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