← Uber Interview Insights

Uber·Data Scientist·Technical Phone Screen·Senior

Senior
Apr 2026

Summary

Uber DS interview focused almost entirely on CTR prediction for ads, and it went deep fast. Five interconnected questions covering modeling, imbalance handling, evaluation metrics, calibration, and production validation. The kind of loop where you realize halfway through that they actually want you to know this stuff cold.

Questions Asked (5)

Q1

You're building a model to predict whether an ad impression leads to a click within 24 hours. The positive rate is around 0.7%. Propose two model families suited for extreme class imbalance and high-cardinality sparse features. How would you encode ad_id and campaign_id without leaking information, and what does your cross-validation scheme look like given that some click labels arrive up to 24 hours late?

System DesignTechnical Trade-offsData Modeling
Author's notes

This was the opener and it set the tone.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging the extreme imbalance and sparse high-cardinality features, then propose two model families: (1) tree-based ensembles with techniques like scale_pos_weight or focal loss, and (2) regularized linear models with hashing or embeddings. For encoding, use out-of-fold target encoding or frequency encoding with smoothing, and design a time-aware cross-validation that respects the 24-hour label delay by using a holdout period or time-series splits.

Pro tip: Emphasize that the 24-hour label delay introduces a feedback loop: using recent data for validation can leak future clicks. Propose a 'label maturation' window and simulate production by training on data older than 24 hours and validating on the most recent matured data.

1. Model Families for Imbalance and Sparsity

Propose two families: (1) Gradient boosted trees (e.g., XGBoost/LightGBM) with scale_pos_weight or focal loss, and (2) Regularized logistic regression with feature hashing or embeddings for high-cardinality features. Mention that tree models handle sparsity well, while linear models with hashing are scalable.

2. Encoding High-Cardinality Features

For ad_id and campaign_id, avoid one-hot encoding due to dimensionality. Use out-of-fold target encoding with smoothing (e.g., additive smoothing) or frequency encoding. Alternatively, use learned embeddings via a neural network. Ensure encoding is computed only on training folds to prevent leakage.

3. Handling Label Delay in Cross-Validation

Design a time-based cross-validation scheme that accounts for the 24-hour label delay. Use a holdout set of the most recent data that has fully matured (i.e., older than 24 hours) for validation, and train on data prior to that. Alternatively, use a sliding window approach where the validation set is always at least 24 hours behind the training set.

4. Evaluation Metrics and Calibration

Given the 0.7% positive rate, use metrics like AUC-ROC, PR-AUC, and log loss. Calibrate probabilities if needed. Discuss the trade-off between precision and recall and how it aligns with business goals (e.g., cost per click).

5. Addressing Potential Leakage and Production Readiness

Mention that target encoding must be done within CV folds to avoid leakage. Also, ensure that features are available at prediction time and that the model can handle new ad_ids/campaign_ids via hashing or embeddings. Discuss monitoring for concept drift.

Key Points to Mention

  • Extreme class imbalance: use techniques like scale_pos_weight, focal loss, or resampling (but caution with resampling for probabilistic calibration).
  • High-cardinality sparse features: hashing trick, embeddings, or target encoding with smoothing.
  • Out-of-fold target encoding to prevent leakage.
  • Time-aware cross-validation respecting the 24-hour label delay (e.g., holdout of matured data).
  • Evaluation metrics: PR-AUC is more informative than ROC-AUC for imbalanced data.
  • Production considerations: feature availability, handling unseen categories, and monitoring.

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

Q2

Compare class weighting, focal loss, undersampling, and calibrated thresholding for handling severe class imbalance. In what situation would you avoid synthetic oversampling, and how do each of these choices affect ranking performance versus calibration?

Technical Trade-offsProduct Analytics & Metrics
Author's notes

Synthetic oversampling on sparse, high-cardinality feature spaces is a bad idea and I said so pretty quickly.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem: severe class imbalance affects both model training and evaluation. Then compare each method across two dimensions: ranking performance (e.g., AUC, PR-AUC) and calibration (reliability of predicted probabilities). Finally, discuss when to avoid synthetic oversampling, emphasizing risks like overfitting and distribution shift.

Pro tip: At Uber, where decisions often rely on calibrated probabilities (e.g., pricing, fraud), emphasize that thresholding and calibration are critical, and that synthetic oversampling can distort probability estimates, making it risky for production.

1. Define the evaluation criteria

Clarify that ranking performance measures how well the model orders positives above negatives (e.g., AUC, PR-AUC), while calibration measures how well predicted probabilities match observed frequencies (e.g., reliability diagrams, Brier score).

2. Analyze class weighting

Class weighting adjusts the loss to penalize minority class errors more. It can improve ranking by focusing on minority class, but may distort calibration because predicted probabilities become biased toward the minority class.

3. Analyze focal loss

Focal loss down-weights easy examples and focuses on hard ones. It often improves ranking for the minority class but can harm calibration, as probabilities may become overconfident or underconfident depending on the focusing parameter.

4. Analyze undersampling

Undersampling balances the training set by removing majority class examples. It can improve ranking by reducing bias toward majority, but may discard useful information and lead to poor calibration due to altered prior probabilities.

5. Analyze calibrated thresholding

Calibrated thresholding involves post-hoc calibration (e.g., Platt scaling, isotonic regression) and then selecting a threshold. It preserves ranking (if monotonic) and improves calibration, making it ideal when probabilities are used for decision-making.

6. Discuss when to avoid synthetic oversampling

Avoid synthetic oversampling (e.g., SMOTE) when the minority class is not well-separated or when synthetic samples could introduce noise, leading to overfitting and poor generalization. Also avoid when calibration is critical, as synthetic samples can distort probability estimates.

Key Points to Mention

  • Class weighting and focal loss modify the loss function, affecting both ranking and calibration; they often improve ranking but require recalibration.
  • Undersampling can improve ranking but may discard valuable majority class information and distort calibration due to changed class prior.
  • Calibrated thresholding (post-hoc calibration) can fix calibration without affecting ranking, as it is a monotonic transformation.
  • Synthetic oversampling (e.g., SMOTE) can lead to overfitting and is risky when the minority class is noisy or when calibration is important.
  • Ranking metrics like AUC are insensitive to class prior, but calibration metrics like Brier score are sensitive; thus, methods that change the prior affect calibration.
  • In production, the choice depends on the business objective: if ranking is key (e.g., search ranking), methods that improve ranking may suffice; if probabilities are used (e.g., fraud detection), calibration is crucial.

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

Q3

Model A has ROC-AUC of 0.91 and PR-AUC of 0.14. Model B has ROC-AUC of 0.88 and PR-AUC of 0.22. Why can these metrics disagree at 0.7% prevalence, which model would you trust for ad CTR prediction, and how do you use a cost matrix around missed clicks versus wasted impressions to pick an operating threshold?

Product Analytics & MetricsTechnical Trade-offsPricing & Monetization
Author's notes

ROC-AUC inflates at low prevalence because it includes a huge number of true negatives that are easy to get right.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining why ROC-AUC and PR-AUC diverge at low prevalence, emphasizing that PR-AUC is more sensitive to false positives and thus more informative for imbalanced problems. Then argue that for ad CTR prediction, Model B is preferable because its higher PR-AUC indicates better precision-recall trade-off at the operating point that matters. Finally, describe how to use a cost matrix to choose a threshold that minimizes total expected cost, balancing missed clicks and wasted impressions.

Pro tip: Mention that the choice of metric should align with the business objective: for ad CTR, where positive class is rare and the cost of false positives (wasted impressions) is significant, PR-AUC is the more reliable metric. Also, note that the optimal threshold depends on the specific cost ratio and can be found by minimizing expected cost on a validation set.

1. Explain metric disagreement

Describe how ROC-AUC uses both true positive rate and false positive rate, which can be misleading when negatives dominate. PR-AUC focuses on the positive class, so it better reflects performance when prevalence is low.

2. Choose the right model for ad CTR

Argue that Model B is more trustworthy because its higher PR-AUC means better precision at relevant recall levels, which is crucial for ad CTR where false positives (wasted impressions) are costly.

3. Define the cost matrix

Assign costs: C_FN for missed clicks (lost revenue) and C_FP for wasted impressions (lost opportunity and potential user annoyance). Typically, C_FN > C_FP but both matter.

4. Compute expected cost and select threshold

For each threshold, compute expected cost = C_FN * FN + C_FP * FP on a validation set. Choose the threshold that minimizes this cost, possibly subject to business constraints.

5. Validate and monitor

Validate the chosen threshold on holdout data and monitor performance over time, adjusting as costs or prevalence change.

Key Points to Mention

  • ROC-AUC is insensitive to class imbalance because it uses both classes, while PR-AUC focuses on the positive class and is more informative when prevalence is low.
  • At 0.7% prevalence, a high ROC-AUC can be achieved even with many false positives, but PR-AUC will penalize that, making it a better metric for imbalanced problems like ad CTR.
  • Model B has higher PR-AUC, indicating better precision-recall trade-off, which is critical for ad CTR where false positives (wasted impressions) are costly.
  • A cost matrix quantifies the relative costs of false negatives (missed clicks) and false positives (wasted impressions).
  • The optimal threshold minimizes expected cost: C_FN * FN + C_FP * FP, and can be found by evaluating thresholds on a validation set.
  • The cost ratio C_FN/C_FP determines the threshold: higher ratio favors lower thresholds to capture more clicks, while higher C_FP favors higher thresholds to reduce wasted impressions.

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

Q4

How would you assess and fix model calibration using isotonic regression versus Platt scaling? Walk through selecting a threshold to maximize F1 versus one that maximizes expected profit. How do you compute precision at the top 1% of scores and use it to compare models?

Technical Trade-offsProduct Analytics & MetricsA/B Testing & Experimentation
Author's notes

Platt scaling assumes a sigmoid relationship between raw scores and probabilities, so it works better when the model is roughly monotone but miscalibrated in a smooth way.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by comparing isotonic regression and Platt scaling in terms of flexibility, data requirements, and overfitting risk, then explain how to choose between them based on dataset size and calibration curve shape. Next, describe how to select a threshold by optimizing the desired metric (F1 or expected profit) using validation data, and finally detail the computation of precision at the top 1% of scores and its use in model comparison.

Pro tip: Emphasize that calibration should be evaluated on a held-out set and that business metrics like expected profit often require incorporating costs and benefits, which may lead to thresholds very different from those that maximize F1.

1. Compare calibration methods

Discuss isotonic regression as a non-parametric, flexible method that requires more data but can capture complex relationships, versus Platt scaling as a parametric, sigmoid-based method that works well with small data but assumes a specific shape.

2. Assess calibration quality

Use reliability diagrams and metrics like Brier score or log loss to evaluate calibration on a validation set, and consider the bias-variance trade-off when choosing between the two methods.

3. Select threshold for F1 vs. profit

For F1, compute precision and recall across thresholds and pick the one that maximizes the harmonic mean; for expected profit, define a profit function that incorporates true positive benefit and false positive cost, then choose the threshold that maximizes expected profit on validation data.

4. Compute precision at top 1%

Rank predictions by score, take the top 1% highest scores, and calculate the proportion of true positives among them; this measures the model's ability to identify the most likely positives.

5. Compare models using precision@top1%

Use precision at top 1% as a business-relevant metric to compare models, especially when the application requires high precision in the highest-scoring segment, and combine it with other metrics for a holistic view.

Key Points to Mention

  • Isotonic regression is non-parametric and can overfit with small data, while Platt scaling is parametric and more robust but less flexible.
  • Calibration should be evaluated on a separate validation set to avoid overfitting.
  • Threshold selection depends on the objective: F1 balances precision and recall, while expected profit incorporates business costs and benefits.
  • Precision at top 1% is computed by sorting scores, taking the top 1%, and calculating the proportion of true positives.
  • This metric is useful for comparing models when the top-ranked predictions are most critical, such as in fraud detection or targeted marketing.
  • Always consider the trade-off between calibration and discrimination; a well-calibrated model may still have poor ranking ability.

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

Q5

Design a bucket test to validate whether the model's scores actually lift CTR in production using a top-k targeting setup. What logs do you need to detect covariate drift and label delay, and how do you prevent feedback loops from corrupting future training data?

A/B Testing & ExperimentationSystem DesignRoot Cause Analysis
Author's notes

Feedback loops were the part I hadn't thought through carefully enough before this interview.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by outlining a randomized bucket test where users are split into treatment (model top-k targeting) and control (baseline targeting), with CTR as the primary metric. Then detail the logging infrastructure needed to capture model scores, user features, and outcomes for drift and delay detection. Finally, explain safeguards like exploration, delayed feedback handling, and data hygiene to prevent feedback loops.

Pro tip: Emphasize that in top-k targeting, the treatment group only sees top-k items, so you must log the full ranking to avoid selection bias and ensure unbiased evaluation of the model's lift.

1. Design the bucket test

Randomly assign users to treatment (model top-k) and control (baseline) buckets, ensuring consistent assignment and sufficient power. Define success metrics (CTR lift) and guardrail metrics (e.g., revenue, user satisfaction).

2. Define logging requirements

Log model scores, user features, item features, top-k selections, and outcomes (clicks, impressions) with timestamps. Include request IDs to join logs across systems and capture the full ranking for unbiased analysis.

3. Detect covariate drift and label delay

Monitor feature distributions (e.g., PSI, KL divergence) and prediction distributions over time to detect drift. Track label arrival times and use techniques like delayed feedback modeling or imputation to handle label delay.

4. Prevent feedback loops

Introduce exploration (e.g., epsilon-greedy) to collect unbiased data, use inverse propensity scoring (IPS) to correct for selection bias, and maintain a holdout set to evaluate model performance without feedback contamination.

5. Validate and iterate

Analyze test results with proper statistical methods (e.g., sequential testing), check for drift and delay impact, and iterate on model and logging based on findings.

Key Points to Mention

  • Randomized controlled experiment with treatment and control groups
  • Logging model scores, user features, item features, and outcomes with timestamps
  • Covariate drift detection using statistical tests (e.g., PSI, KL divergence)
  • Label delay handling via delayed feedback models or imputation
  • Feedback loop prevention through exploration and inverse propensity scoring
  • Holdout set to evaluate model performance without feedback contamination

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