← Uber Interview Insights

Uber·Machine Learning Engineer·Technical Phone Screen·Senior

Senior
May 2026

Summary

Went through a technical screen for an MLE role at Uber focused entirely on ML concepts. Four questions back to back, all conceptual, no coding. Felt like a theory exam more than a conversation.

Questions Asked (4)

Q1

In gradient-boosted decision trees, how does maximum tree depth affect bias, variance, and overfitting risk? How does it impact training and inference cost, and how would you pick it in practice?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

This one I actually felt okay about.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer by first explaining how max depth controls model complexity, then connect it to the bias-variance trade-off and overfitting risk. Next, discuss the computational implications for training and inference, and finally outline a practical tuning strategy using validation curves and early stopping.

Pro tip: Emphasize that in GBDT, depth interacts with learning rate and number of trees—deeper trees require lower learning rates and fewer boosting rounds to avoid overfitting. Mention that shallow trees (e.g., depth 3-6) often work best in practice, especially for large-scale production systems like Uber's.

1. Define max depth and its role

Explain that max depth limits the number of splits from root to leaf, directly controlling the complexity of each individual tree. Deeper trees can capture more intricate feature interactions but are more prone to memorizing noise.

2. Analyze bias-variance impact

Describe how increasing depth reduces bias (better fit to training data) but increases variance (sensitivity to training samples). Overfitting risk rises as depth grows, especially with noisy data or small datasets.

3. Discuss computational cost

Training cost grows with depth because more splits require more computations per tree, and deeper trees often need more boosting rounds. Inference cost also increases due to longer paths and more nodes to traverse per tree.

4. Outline practical tuning strategy

Start with a moderate depth (e.g., 3-6) and use cross-validation to monitor validation error. Tune depth jointly with learning rate and number of trees, using early stopping to prevent overfitting. Consider hardware and latency constraints for inference.

Key Points to Mention

  • Bias-variance trade-off: deeper trees lower bias but raise variance.
  • Overfitting risk increases with depth, especially with noisy data or small samples.
  • Training cost: deeper trees require more computation per tree and often more boosting iterations.
  • Inference cost: deeper trees increase latency due to longer traversal paths.
  • Interaction with learning rate: deeper trees need lower learning rates to avoid overfitting.
  • Practical tuning: use validation curves, start with depth 3-6, and consider early stopping.

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

Q2

In neural networks, compare L1 regularization, L2 regularization, and weight decay. How does each one change the loss objective, the gradient updates, and the resulting weights?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

Knew L1 vs L2 cold, but weight decay tripped me up a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining each method in terms of the loss objective, then contrast their gradient updates and resulting weight behavior. Emphasize the subtle distinction between L2 regularization and weight decay, especially in adaptive optimizers like Adam, and connect to practical implications for model generalization.

Pro tip: Mention that in adaptive optimizers like Adam, L2 regularization and weight decay are not equivalent; decoupled weight decay (AdamW) often yields better generalization. This shows awareness of modern best practices and can set you apart.

1. Define L1 Regularization

Explain that L1 adds the sum of absolute weights to the loss, leading to sparse solutions. Describe the gradient update: constant penalty on the sign of the weight, which drives small weights to exactly zero.

2. Define L2 Regularization

Explain that L2 adds the sum of squared weights to the loss, leading to weight shrinkage. Describe the gradient update: penalty proportional to the weight value, which smoothly decays weights toward zero but rarely to exactly zero.

3. Define Weight Decay

Explain that weight decay multiplies weights by a factor less than one at each update, independent of the loss gradient. In SGD, it is equivalent to L2 regularization, but in adaptive optimizers, it differs because it decouples the decay from the gradient-based update.

4. Compare Gradient Updates and Weight Behavior

Contrast the updates: L1 produces constant push toward zero (sparsity), L2 produces proportional push (shrinkage), and weight decay produces multiplicative decay. Discuss how these affect the final weights and model complexity.

5. Discuss Practical Implications

Mention that L1 is used for feature selection, L2 for general regularization, and weight decay for preventing overfitting in deep networks. Highlight that in Adam, L2 regularization is not the same as weight decay, and AdamW is preferred.

Key Points to Mention

  • L1 regularization adds |w| to the loss, leading to sparse weights and feature selection.
  • L2 regularization adds w^2 to the loss, leading to weight shrinkage and smoother models.
  • Weight decay multiplies weights by (1 - lambda * lr) each update, which is equivalent to L2 in SGD but not in adaptive optimizers.
  • In Adam, L2 regularization is added to the loss, but the gradient is scaled by the adaptive learning rate, so the effective decay is not uniform; decoupled weight decay (AdamW) fixes this.
  • Sparsity from L1 can be useful for interpretability and compression, but may hurt performance if not tuned.
  • Weight decay is a common regularizer in deep learning, often implemented as a separate step in the optimizer.

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

Q3

After using dropout during training, what do you need to do differently at inference time, and why?

Technical Trade-offs
Author's notes

Scale the activations.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Explain that dropout is only active during training and must be disabled at inference to use the full network capacity. Describe how this is typically done (e.g., scaling weights or using inverted dropout) and why it ensures deterministic, consistent predictions.

Pro tip: Mention that frameworks like TensorFlow and PyTorch handle this automatically via model.eval() or training=False, but understanding the underlying scaling (inverted dropout) shows depth and avoids common pitfalls in custom implementations.

1. State the core difference

Clarify that dropout randomly zeroes activations during training but must be turned off at inference to use the full network.

2. Explain the scaling mechanism

Describe how inverted dropout scales activations during training so that no scaling is needed at inference, or alternatively, how weights are scaled at inference if using classic dropout.

3. Discuss implementation in practice

Mention that deep learning frameworks provide a switch (e.g., model.eval() in PyTorch, training=False in Keras) to disable dropout and other training-specific layers.

4. Highlight the rationale

Explain that disabling dropout ensures deterministic outputs and uses the ensemble effect of dropout, leading to more robust predictions.

Key Points to Mention

  • Dropout is a regularization technique active only during training.
  • At inference, dropout must be disabled to avoid random predictions.
  • Inverted dropout scales activations during training, so no scaling is needed at test time.
  • Frameworks like PyTorch and TensorFlow handle this automatically with model.eval() or training=False.
  • Disabling dropout ensures deterministic and consistent outputs.
  • Using dropout at inference would reduce model capacity and introduce noise.

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

Q4

Define training versus inference for ML models. How do the data flows differ, what role does randomness play in each, and what are the performance tradeoffs to consider?

System DesignTechnical Trade-offs
Author's notes

Broader than I expected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining training and inference, then contrast their data flows, randomness roles, and performance tradeoffs. Use a concrete example like Uber's ML systems to illustrate the differences and show how these considerations impact system design.

Pro tip: Emphasize that training is throughput-oriented and inference is latency-oriented, and discuss how randomness (e.g., dropout, data shuffling) is crucial for generalization but must be controlled during inference for consistency.

1. Define Training and Inference

Clearly state that training is the process of learning model parameters from data, while inference is using the trained model to make predictions on new data.

2. Compare Data Flows

Explain that training involves large-scale batch processing with forward and backward passes, while inference typically involves smaller, real-time requests with only forward passes.

3. Discuss Randomness

Highlight that randomness in training (e.g., weight initialization, dropout, data shuffling) aids generalization, whereas inference should be deterministic (e.g., disabling dropout) for consistent predictions.

4. Analyze Performance Tradeoffs

Contrast the focus on throughput and convergence in training versus latency, cost, and scalability in inference, and mention techniques like quantization and pruning for inference optimization.

5. Relate to Uber's Context

Connect the concepts to Uber's use cases, such as dynamic pricing or ETA prediction, where training might use historical data and inference must be real-time and reliable.

Key Points to Mention

  • Training uses backpropagation and gradient descent; inference uses forward propagation only.
  • Randomness in training: dropout, batch normalization, data augmentation; inference: deterministic, no dropout.
  • Training optimizes for throughput and convergence; inference optimizes for latency and cost.
  • Data flow differences: training processes large batches offline; inference handles single or small batches online.
  • Performance tradeoffs: model size vs. latency, accuracy vs. speed, and hardware considerations (GPU vs. CPU).
  • Uber-specific: real-time inference for services like Uber Eats recommendations or driver matching.

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