← Amazon Interview Insights

Amazon·Machine Learning Engineer·Technical Phone Screen·Senior

Senior
Apr 2026

Summary

Breadth-style ML interview for a senior role at Amazon, covering basically the whole ML curriculum in one sitting. Nine questions, fast pace, felt like a written exam more than a conversation. Some were straightforward, a couple had follow-up angles I didn't fully anticipate.

Questions Asked (9)

Q1

What is a p-value and how should it be interpreted? What are the common ways people misuse it?

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

I gave the textbook definition (probability of seeing data at least this extreme under the null) but fumbled a bit when pushed on what it does NOT mean.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining a p-value precisely as the probability of observing data at least as extreme as the observed, assuming the null hypothesis is true. Then explain its role in hypothesis testing and decision-making, emphasizing that it is not the probability that the null hypothesis is true. Finally, discuss common misinterpretations and misuses, especially in the context of A/B testing and ML experiments, and how to avoid them.

Pro tip: Emphasize that p-values should be interpreted alongside effect sizes and confidence intervals, and that practical significance matters more than statistical significance in business decisions. Mention that at Amazon, we often use Bayesian methods or sequential testing to avoid some p-value pitfalls.

1. Define p-value

State that a p-value is the probability of obtaining test results at least as extreme as those observed, given that the null hypothesis is true. Clarify that it is not the probability that the null hypothesis is true or that the results are due to chance.

2. Explain interpretation

Describe how a small p-value indicates that the observed data are unlikely under the null hypothesis, leading to rejection of the null hypothesis if below a pre-specified significance level (e.g., 0.05). Stress that it does not measure the size or importance of an effect.

3. Discuss common misuses

List frequent misinterpretations: equating p-value with the probability that the null is true, treating it as a measure of effect size, p-hacking, multiple comparisons without correction, and using it as the sole decision criterion.

4. Relate to ML/experimentation context

Explain how these misuses manifest in A/B testing and ML experiments, such as peeking at results, running multiple tests without adjustment, and ignoring practical significance. Mention alternatives like confidence intervals, effect sizes, and Bayesian methods.

5. Conclude with best practices

Summarize best practices: pre-register hypotheses, correct for multiple comparisons, report effect sizes and confidence intervals, and consider practical significance. Emphasize that p-values are just one piece of evidence.

Key Points to Mention

  • Definition: p-value is the probability of observing data at least as extreme as the observed, assuming the null hypothesis is true.
  • Interpretation: small p-value suggests evidence against the null hypothesis, but does not prove the alternative or measure effect size.
  • Common misuse: interpreting p-value as the probability that the null hypothesis is true or that results are due to chance.
  • Common misuse: p-hacking, multiple comparisons without correction, and peeking at data (optional stopping).
  • Importance of effect size, confidence intervals, and practical significance in decision-making.
  • Alternatives and complements: Bayesian methods, sequential testing, and pre-registration to avoid pitfalls.

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

Q2

What are overfitting and underfitting? How do you know which one you're dealing with, and what do you do about it?

Technical Trade-offs
Author's notes

Pretty standard, talked through train vs validation loss patterns.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Define overfitting and underfitting clearly, then explain how to diagnose them using learning curves and validation metrics. Finally, discuss mitigation strategies for each, emphasizing the trade-off and the importance of validation.

Pro tip: Mention that in practice, you often start with a slightly overfit model and then regularize, because it's easier to reduce overfitting than to fix underfitting. Also, relate it to Amazon's customer obsession by focusing on generalization to unseen data.

1. Define the concepts

Clearly define overfitting (model learns noise, high variance) and underfitting (model too simple, high bias).

2. Diagnose using metrics and curves

Explain how to use training vs validation error and learning curves to identify which issue you have.

3. Address underfitting

Discuss solutions like increasing model complexity, adding features, reducing regularization.

4. Address overfitting

Discuss solutions like more data, regularization (L1/L2, dropout), early stopping, cross-validation, simpler models.

5. Emphasize trade-off and iteration

Highlight that it's a balancing act and you iterate based on validation performance.

Key Points to Mention

  • Bias-variance trade-off
  • Training vs validation error
  • Learning curves
  • Regularization techniques (L1, L2, dropout)
  • Cross-validation
  • Early stopping
  • More data or data augmentation
  • Model complexity (e.g., polynomial degree, tree depth)

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

Q3

What is causal inference and what methods exist for establishing causality from data?

A/B Testing & ExperimentationRoot Cause Analysis
Author's notes

This one tripped me up a little.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining causal inference as the process of determining whether a cause-effect relationship exists between variables, distinguishing it from correlation. Then, structure your answer by categorizing methods into experimental (e.g., A/B testing) and observational (e.g., matching, instrumental variables), and briefly explain how each addresses confounding. Finally, tie it back to the role by mentioning applications in ML engineering, such as evaluating model impact or root cause analysis.

Pro tip: Emphasize that while A/B testing is the gold standard, observational methods are crucial when experiments are infeasible, and demonstrate awareness of assumptions like ignorability and positivity. Also, mention how causal inference can improve ML models by avoiding spurious correlations and enabling counterfactual reasoning.

1. Define causal inference

Explain that causal inference is about estimating the effect of an intervention or treatment on an outcome, going beyond association to establish cause-effect relationships.

2. Distinguish from correlation

Highlight that correlation does not imply causation due to confounding, reverse causality, and selection bias, and that causal inference aims to address these issues.

3. Categorize methods

Group methods into experimental (randomized controlled trials, A/B testing) and observational (matching, propensity score, instrumental variables, regression discontinuity, difference-in-differences).

4. Explain key assumptions

Mention assumptions like ignorability (no unmeasured confounders), positivity, and SUTVA that underlie causal inference methods.

5. Connect to ML engineering

Discuss how causal inference is used in A/B testing, root cause analysis, and building robust ML models that generalize under interventions.

Key Points to Mention

  • Randomized controlled trials (A/B testing) as the gold standard for establishing causality.
  • Observational methods: matching, propensity score weighting, instrumental variables, regression discontinuity, difference-in-differences.
  • Confounding and the need to control for it.
  • Potential outcomes framework (Rubin causal model) and do-calculus (Pearl).
  • Applications in tech: evaluating feature impact, root cause analysis, and counterfactual reasoning in ML.
  • Assumptions: ignorability, positivity, SUTVA, and no interference.

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

Q4

What do encoding and decoding mean in the context of machine learning? Give some concrete examples.

Technical Trade-offsSystem Design
Author's notes

Talked about autoencoders and sequence-to-sequence models.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining encoding and decoding as inverse transformations between raw data and a learned representation, then explain their roles in ML workflows. Use concrete examples from different domains (e.g., text, images, audio) to illustrate how encoding compresses or extracts features and decoding reconstructs or generates outputs. Finally, tie it back to trade-offs like information loss, computational cost, and task-specific design choices.

Pro tip: Emphasize that encoding and decoding are not just for autoencoders—they appear in feature engineering, model inference, and even data pipelines. At Amazon, show how you'd choose an encoding/decoding scheme based on latency, accuracy, and scale requirements.

1. Define the concepts

Explain that encoding transforms raw input into a compact or meaningful representation (e.g., embeddings, feature vectors), while decoding maps that representation back to the original space or to a desired output.

2. Explain the purpose

Highlight why encoding/decoding are used: dimensionality reduction, denoising, compression, transfer learning, and generation. Mention that they are often learned jointly in models like autoencoders.

3. Provide concrete examples

Give 2-3 specific examples: (1) text: tokenization + embedding (encoding) and language model head (decoding); (2) images: CNN encoder + transposed convolution decoder in segmentation; (3) audio: spectrogram encoding and vocoder decoding.

4. Discuss trade-offs and design choices

Talk about trade-offs: lossy vs. lossless, latent space size, computational cost, and task-specific objectives. Mention how Amazon might prioritize low-latency decoding for real-time recommendations.

5. Connect to system design

Relate encoding/decoding to system design: e.g., feature stores encode features for online serving, and decoders generate final outputs. Emphasize scalability and monitoring.

Key Points to Mention

  • Autoencoders and variational autoencoders as classic examples of joint encoding-decoding.
  • Encoding in NLP: tokenization, word embeddings, and contextual representations (e.g., BERT).
  • Decoding in NLP: language model heads, beam search, and text generation.
  • Encoding in computer vision: CNN feature extractors; decoding: upsampling, transposed convolutions for segmentation.
  • Trade-offs: information bottleneck, reconstruction loss, and downstream task performance.
  • Real-world systems: recommendation systems encode user/item features and decode to ranking scores.

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

Q5

Can you explain gradient descent and backpropagation at a high level?

Algorithms & Data Structures
Author's notes

Comfortable territory.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining gradient descent as an optimization algorithm that iteratively adjusts parameters to minimize a loss function, then explain backpropagation as the method to compute gradients efficiently using the chain rule. Emphasize their complementary roles: backpropagation calculates gradients, and gradient descent uses them to update weights. Keep the explanation high-level, focusing on intuition rather than detailed math.

Pro tip: Relate the concepts to a real-world analogy, such as hiking down a mountain (gradient descent) and using a map to find the steepest path (backpropagation), to make your answer memorable. Also, mention how these are foundational to training neural networks, showing you understand their practical importance.

1. Define Gradient Descent

Explain that gradient descent is an iterative optimization algorithm used to minimize a loss function by updating parameters in the opposite direction of the gradient.

2. Explain the Role of Gradients

Describe how the gradient indicates the direction of steepest ascent, so moving opposite to it reduces the loss. Mention the learning rate as the step size.

3. Introduce Backpropagation

Define backpropagation as an algorithm to efficiently compute gradients of the loss with respect to all weights in a neural network using the chain rule.

4. Connect Backpropagation to Gradient Descent

Explain that backpropagation provides the gradients needed by gradient descent to update the weights, forming the core training loop of neural networks.

5. Summarize with an Analogy or Example

Use a simple analogy (e.g., descending a hill) or a brief example (e.g., linear regression) to reinforce understanding and show practical application.

Key Points to Mention

  • Gradient descent is an iterative optimization algorithm that minimizes a loss function by updating parameters in the direction of the negative gradient.
  • The learning rate controls the step size and affects convergence.
  • Backpropagation uses the chain rule to compute gradients of the loss with respect to each weight in the network.
  • Backpropagation is efficient because it reuses computations from the forward pass and propagates errors backward.
  • Together, they form the backbone of training neural networks: backpropagation computes gradients, and gradient descent updates weights.
  • Variants like stochastic gradient descent (SGD) and Adam are commonly used in practice.

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

Q6

What are vanishing and exploding gradients, why do they happen, and how do you address them?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

Good question to pair with the previous one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining vanishing and exploding gradients clearly, then explain their root causes in backpropagation through deep networks or RNNs. Finally, discuss practical mitigation strategies, emphasizing trade-offs and when to apply each. Tailor your answer to Amazon's scale by mentioning distributed training and large models.

Pro tip: Mention that gradient clipping is a quick fix for exploding gradients but doesn't solve vanishing gradients, and that architectural choices like residual connections are often more effective long-term. Also, relate to Amazon's context by noting that these issues are critical in training large-scale recommendation models and LLMs.

1. Define the phenomena

Explain that vanishing gradients cause early layers to learn very slowly or not at all, while exploding gradients cause unstable training and divergence due to exponentially growing gradients.

2. Explain why they happen

Discuss how repeated multiplication of gradients (chain rule) in deep networks or long sequences leads to gradients that shrink (vanishing) or grow (exploding), especially with saturating activations like sigmoid/tanh or poor weight initialization.

3. List mitigation techniques

Cover techniques such as proper weight initialization (Xavier/He), non-saturating activations (ReLU), batch normalization, residual connections, gradient clipping, and specialized architectures (LSTM/GRU, Transformers).

4. Discuss trade-offs and practical considerations

Highlight that some solutions address only one problem (e.g., gradient clipping for exploding) and that architectural changes may be more effective but require more design effort. Mention monitoring gradient norms during training.

5. Relate to Amazon's context

Connect to Amazon's use of deep learning at scale, such as in recommendation systems, Alexa, and AWS SageMaker, where these issues are common and solutions must be robust and scalable.

Key Points to Mention

  • Definition: vanishing gradients cause slow learning in early layers; exploding gradients cause unstable training.
  • Causes: chain rule in deep networks/RNNs, saturating activations, poor initialization, long sequences.
  • Solutions for vanishing: ReLU, residual connections, LSTM/GRU, batch normalization, proper initialization.
  • Solutions for exploding: gradient clipping, weight regularization, careful initialization.
  • Trade-offs: gradient clipping is simple but doesn't help vanishing; residual connections add parameters but improve gradient flow.
  • Monitoring: track gradient norms to detect issues early; use tools like TensorBoard.

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

Q7

How do you approach training a model when the class distribution is heavily skewed?

Technical Trade-offsProduct Analytics & Metrics
Author's notes

Resampling, class weights, threshold tuning, and using the right metrics (F1, AUC, precision-recall).

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the business context and the cost of different error types, then discuss a combination of data-level and algorithm-level techniques to handle class imbalance. Emphasize evaluation metrics beyond accuracy and the importance of validating with a proper validation strategy. Conclude with how you would iterate and monitor the model in production.

Pro tip: At Amazon, tie your approach to customer impact and business metrics—show that you understand the trade-offs between false positives and false negatives in the context of the product. Also, mention that you would start with a simple baseline and only add complexity if needed.

1. Understand the Business Problem and Data

Clarify the goal, the cost of misclassification, and the current class distribution. Explore the data to understand if the imbalance is inherent or due to sampling.

2. Choose Appropriate Evaluation Metrics

Select metrics like precision, recall, F1, AUC-ROC, or AUC-PR that are robust to imbalance. Align these with business objectives (e.g., minimize false negatives for fraud detection).

3. Apply Data-Level Techniques

Consider resampling methods such as oversampling the minority class (e.g., SMOTE) or undersampling the majority class. Be aware of the risks like overfitting or information loss.

4. Apply Algorithm-Level Techniques

Use class weights, cost-sensitive learning, or ensemble methods like balanced random forests. Adjust decision thresholds to optimize for the chosen metric.

5. Validate and Iterate

Use stratified cross-validation to ensure representative splits. Monitor performance on a holdout set and iterate on the approach based on business impact.

Key Points to Mention

  • Cost-sensitive learning and class weights
  • Resampling techniques (SMOTE, undersampling, oversampling)
  • Evaluation metrics like precision-recall AUC, F1-score
  • Stratified cross-validation and proper validation strategy
  • Threshold tuning to balance precision and recall
  • Ensemble methods like balanced bagging or boosting

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

Q8

Your model shows 99% accuracy but is clearly not working well in practice. What's going on and how do you evaluate it properly?

Product Analytics & MetricsRoot Cause Analysis
Author's notes

Class imbalance is the obvious answer and I led with that.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Acknowledge that high offline accuracy often fails to translate to real-world performance due to issues like data leakage, distribution shift, or inappropriate metrics. Then, outline a systematic evaluation strategy that includes diagnosing the root cause and implementing robust monitoring and validation.

Pro tip: Emphasize the importance of aligning offline metrics with online business metrics, and mention the value of shadow deployment or A/B testing to catch discrepancies early.

1. Identify potential causes

Consider data leakage, overfitting, distribution shift, or improper train-test split. Check if the evaluation metric aligns with the business objective.

2. Validate data and model

Audit the data pipeline for leakage, ensure the test set is representative, and verify that the model isn't overfitting to the training data.

3. Re-evaluate with proper metrics

Use metrics that reflect real-world performance, such as precision/recall, F1, AUC, or business-specific KPIs. Consider cost-sensitive evaluation.

4. Implement online evaluation

Deploy the model in a shadow mode or run A/B tests to compare against current production. Monitor for drift and performance degradation.

5. Iterate and monitor

Set up continuous monitoring, retrain with fresh data, and establish a feedback loop to quickly address issues.

Key Points to Mention

  • Data leakage: e.g., target leakage or temporal leakage in time-series data.
  • Distribution shift: training data not representative of production data.
  • Overfitting: model memorizes training data but fails to generalize.
  • Inappropriate metric: accuracy misleading for imbalanced classes.
  • Offline-online gap: need for online evaluation like A/B testing.
  • Monitoring and retraining: importance of MLOps practices.

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

Q9

What is an A/B test? If the results look weird or suspicious, what could explain that and how would you dig into it?

A/B Testing & ExperimentationRoot Cause Analysis
Author's notes

The first part is easy.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining an A/B test as a randomized controlled experiment comparing two variants to measure causal impact on a metric. Then, for suspicious results, outline a systematic debugging process covering data quality, experiment design, statistical validity, and business context. Emphasize the importance of checking assumptions and using statistical tools to distinguish real effects from noise or bias.

Pro tip: Always validate the experiment's infrastructure first—check for sample ratio mismatch (SRM) and data pipeline issues before interpreting results. This shows you understand that most 'weird' results stem from execution flaws, not genuine effects.

1. Define A/B Testing

Explain that an A/B test is a randomized experiment where users are split into control and treatment groups to measure the causal effect of a change on a predefined metric.

2. Identify Suspicious Signals

List common red flags: unexpected direction or magnitude of effect, high variance, SRM, novelty effects, or results that contradict prior knowledge.

3. Check Data and Experiment Integrity

Verify randomization, sample ratio, data completeness, and metric definitions. Look for bot traffic, logging errors, or pipeline failures.

4. Analyze Statistical Validity

Re-examine p-values, confidence intervals, power, and multiple testing corrections. Consider segment analysis to uncover heterogeneous effects.

5. Investigate External Factors

Consider seasonality, concurrent experiments, or system changes that could confound results. Validate with holdout or replication if needed.

Key Points to Mention

  • Randomization and control group
  • Sample Ratio Mismatch (SRM)
  • Statistical significance and power
  • Novelty and primacy effects
  • Data quality and logging errors
  • Segment analysis and heterogeneous treatment effects

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