← Amazon Interview Insights

Amazon·Machine Learning Engineer·Technical Phone Screen·Senior

Senior
May 2026

Summary

Deep technical screen for an ML Engineer role at Amazon, covering everything from evaluation design to optimizer theory. The interviewer clearly wanted to stress-test whether you actually understand the tradeoffs behind your choices, not just recite definitions. Pretty intense across all four sections.

Questions Asked (10)

Q1

Walk me through how you evaluate a supervised ML model end-to-end, including your data split strategy, validation protocol, and how you use the test set.

Technical Trade-offsProduct Analytics & Metrics
Author's notes

I laid out the standard train/val/test split and explained why you never touch the test set until the very end.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer as a clear, end-to-end pipeline: start with data splitting and validation strategy, then cover model training and evaluation metrics, and finish with test set usage and iteration. Emphasize how your choices prevent data leakage and ensure generalization, and tie your approach to business impact.

Pro tip: Show that you treat the test set as a one-time, final check and never use it for tuning; mention that you sometimes use a holdout set for final validation if time-series or group structures exist. Also, highlight that you document your evaluation protocol to ensure reproducibility.

1. Data Splitting Strategy

Explain how you split data into train, validation, and test sets, considering temporal, group, or stratified sampling to avoid leakage. Mention typical ratios (e.g., 60/20/20) and why you choose them.

2. Validation Protocol

Describe your validation approach: k-fold cross-validation, nested CV, or a single validation set. Discuss how you use it for hyperparameter tuning and model selection, and how you handle class imbalance or time-series data.

3. Model Training & Evaluation Metrics

Outline how you train models and select evaluation metrics aligned with business goals (e.g., precision/recall, AUC, RMSE). Mention tracking experiments and comparing multiple models.

4. Test Set Usage

Emphasize that the test set is held out until the very end, used only once to estimate final performance. Explain how you avoid test set leakage and how you interpret results.

5. Iteration & Deployment

Discuss how you iterate based on validation results, and how you decide when a model is ready for deployment. Mention monitoring and retraining strategies post-deployment.

Key Points to Mention

  • Data leakage prevention (e.g., temporal splits, group splits)
  • Cross-validation techniques (k-fold, stratified, time-series split)
  • Choice of evaluation metrics aligned with business objectives
  • Hyperparameter tuning using validation set only
  • Test set as a final, unbiased evaluation
  • Reproducibility and documentation of the evaluation process

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

Q2

Which evaluation metrics do you use for your model and why, considering both ML and business tradeoffs?

Product Analytics & MetricsTechnical Trade-offs
Author's notes

This is where I felt most comfortable.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the answer around a specific project, then discuss how you selected metrics by aligning model performance with business objectives. Emphasize the tradeoffs between ML metrics (e.g., precision/recall) and business metrics (e.g., revenue, customer satisfaction), and how you iterated to find the right balance.

Pro tip: Show that you understand Amazon's leadership principles, especially 'Customer Obsession' and 'Deliver Results', by linking metrics to customer impact and business outcomes. Also, mention how you avoid overfitting to a single metric by using guardrail metrics.

1. Set the context

Briefly describe the project, its goal, and the business problem it solved. This grounds your metric choices in a real scenario.

2. List ML metrics

Mention the ML metrics you considered (e.g., precision, recall, F1, AUC) and why they were relevant for the model's task.

3. List business metrics

Explain the business metrics (e.g., conversion rate, revenue lift, customer satisfaction) that mattered to stakeholders and how they align with company goals.

4. Discuss tradeoffs

Articulate the tradeoffs between ML and business metrics, such as how optimizing for precision might reduce recall and impact user experience, and how you balanced them.

5. Explain decision and iteration

Describe how you selected the final metric(s), including any A/B tests or offline evaluations, and how you monitored and iterated over time.

Key Points to Mention

  • Alignment of ML metrics with business KPIs (e.g., precision vs. customer satisfaction)
  • Tradeoffs between false positives and false negatives and their business impact
  • Use of guardrail metrics to prevent negative side effects
  • Offline vs. online evaluation (A/B testing) and their roles
  • Iterative process of metric selection and refinement based on feedback
  • Amazon leadership principles: Customer Obsession, Deliver Results, Dive Deep

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

Q3

Give me the mathematical definitions for metrics like accuracy, precision, recall, F1, ROC-AUC, PR-AUC, log loss, MSE, MAE, and any calibration metrics you'd use.

Technical Trade-offsAlgorithms & Data Structures
Author's notes

Honestly the most stressful part.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer by grouping metrics into classification, regression, and calibration categories. For each metric, state the mathematical definition, explain what it measures, and briefly mention when to use it. Emphasize trade-offs and practical considerations, especially for imbalanced data and probabilistic predictions.

Pro tip: Demonstrate depth by discussing the limitations of each metric (e.g., accuracy misleading for imbalanced data, ROC-AUC insensitive to class balance) and how they relate to business objectives. This shows you can choose the right metric for the problem.

1. Categorize Metrics

Group metrics into classification (accuracy, precision, recall, F1, ROC-AUC, PR-AUC, log loss), regression (MSE, MAE), and calibration (Brier score, calibration curves, ECE). This provides a clear structure.

2. Define Classification Metrics

For each classification metric, provide the formula using TP, TN, FP, FN, and explain its meaning and typical use case. Include threshold-based and threshold-independent metrics.

3. Define Regression Metrics

State the formulas for MSE and MAE, and explain their properties (e.g., sensitivity to outliers, interpretability).

4. Define Calibration Metrics

Explain calibration and provide definitions for Brier score, Expected Calibration Error (ECE), and mention reliability diagrams.

5. Discuss Trade-offs and Practical Use

Highlight when to use each metric, especially for imbalanced data, and how they relate to business goals. Mention that no single metric is perfect.

Key Points to Mention

  • Accuracy = (TP+TN)/(TP+TN+FP+FN); misleading for imbalanced data.
  • Precision = TP/(TP+FP); Recall = TP/(TP+FN); F1 = 2*(Precision*Recall)/(Precision+Recall).
  • ROC-AUC = area under TPR vs FPR curve; PR-AUC = area under Precision vs Recall curve; PR-AUC better for imbalanced data.
  • Log loss = -1/N Σ [y log(p) + (1-y) log(1-p)]; measures probabilistic accuracy.
  • MSE = 1/N Σ (y - ŷ)^2; MAE = 1/N Σ |y - ŷ|; MSE penalizes large errors more.
  • Calibration: Brier score = 1/N Σ (p - y)^2; ECE = Σ |B_m|/N |acc(B_m) - conf(B_m)|; reliability diagrams.

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

Q4

How would you design a more robust evaluation workflow than a single holdout set?

Technical Trade-offsA/B Testing & Experimentation
Author's notes

Talked through k-fold cross-validation, time-based splits for temporal data, stratification for imbalanced classes, and repeated runs with confidence intervals.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging the limitations of a single holdout set (high variance, data leakage risks, and poor generalization). Then propose a multi-layered evaluation workflow that includes cross-validation, nested cross-validation, and a final untouched test set, while also considering time-based splits and statistical significance testing. Emphasize how this approach reduces variance and provides more reliable performance estimates, especially for production ML systems.

Pro tip: Tie your answer to Amazon's leadership principles, such as 'Insist on the Highest Standards' and 'Dive Deep', by explaining how a robust evaluation workflow prevents costly mistakes in production and aligns with a culture of data-driven decision making.

1. Identify limitations of a single holdout

Explain that a single holdout set can lead to high variance in performance estimates, may not represent the full data distribution, and is prone to overfitting if used repeatedly for model selection.

2. Introduce cross-validation techniques

Describe k-fold cross-validation to get a more stable estimate by averaging over multiple train-test splits, and mention stratified or grouped variants to handle class imbalance or group structures.

3. Add nested cross-validation for hyperparameter tuning

Propose nested cross-validation where an inner loop tunes hyperparameters and an outer loop evaluates generalization, preventing optimistic bias from tuning on the same data used for evaluation.

4. Incorporate a final holdout or time-based split

Reserve a completely untouched test set (or use time-based splitting for temporal data) to simulate real-world deployment and provide an unbiased final performance check.

5. Validate with statistical tests and monitor in production

Use statistical significance tests (e.g., paired t-test) to compare models, and plan for continuous monitoring and A/B testing in production to detect drift and ensure robustness.

Key Points to Mention

  • Cross-validation (k-fold, stratified, grouped) to reduce variance
  • Nested cross-validation for unbiased hyperparameter tuning
  • Time-based splitting for temporal data to avoid leakage
  • Statistical significance testing (e.g., confidence intervals, paired tests)
  • Final untouched holdout set for unbiased evaluation
  • Production monitoring and A/B testing for ongoing robustness

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

Q5

If you could incorporate human labels into your evaluation process, what would you label, how would you ensure label quality, and how does it improve your evaluation signal?

Product Analytics & MetricsTechnical Trade-offs
Author's notes

Said I'd focus human labeling on the ambiguous or borderline examples where the model is least confident, since those are the most informative.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by identifying the specific evaluation gaps where human labels add the most value, such as ambiguous edge cases or subjective quality dimensions. Then describe a rigorous labeling process with clear guidelines, calibration, and quality checks. Finally, explain how these labels improve the evaluation signal by providing a more reliable ground truth and enabling better model iteration.

Pro tip: Emphasize the trade-off between label quality and cost, and propose a tiered approach: use human labels for a small, high-impact subset and leverage weak supervision or active learning to scale. This shows you understand Amazon's frugality and bias for action.

1. Identify labeling targets

Pinpoint where human judgment is critical, such as ambiguous queries, subjective relevance, or safety violations, and prioritize based on impact on business metrics.

2. Design labeling guidelines

Create clear, concise instructions with examples and edge cases to ensure consistency, and involve domain experts to validate.

3. Implement quality control

Use multiple annotators per item, measure inter-annotator agreement, and run regular calibration sessions to maintain high label quality.

4. Integrate into evaluation

Combine human labels with automated metrics to create a robust evaluation set, and use it to validate model performance and guide improvements.

5. Measure and iterate

Track how human labels change evaluation outcomes, quantify the improvement in signal, and refine the process based on feedback.

Key Points to Mention

  • Active learning to select the most informative samples for labeling
  • Inter-annotator agreement metrics like Cohen's kappa to ensure label reliability
  • Cost-benefit analysis of human labeling vs. automated proxies
  • Using human labels to create a golden dataset for benchmarking
  • Addressing label noise and bias through adjudication and diverse annotator pools
  • Aligning labels with business objectives and customer impact

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

Q6

If you have no labels at all, what is the simplest way to estimate whether two model outputs are similar?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

Went with embedding cosine similarity as the simplest baseline.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that without labels, we need an unsupervised similarity measure. Then propose the simplest method: compute a distance or similarity metric (e.g., cosine similarity, Euclidean distance) between the model outputs, possibly after normalizing them. Emphasize that the choice depends on the output type (e.g., embeddings, probabilities) and that this is a heuristic, not a definitive evaluation.

Pro tip: Mention that for high-dimensional outputs, cosine similarity is often preferred over Euclidean distance because it focuses on direction rather than magnitude, and it's robust to scaling. Also, note that you can validate the similarity measure by checking if it aligns with human intuition on a small sample.

1. Clarify output type and goal

Determine whether the outputs are embeddings, probability distributions, text, etc., and what 'similar' means in the context (e.g., semantic similarity, structural similarity).

2. Choose a simple metric

Select a basic distance or similarity measure such as cosine similarity, Euclidean distance, or Jaccard similarity, based on the output type.

3. Normalize if needed

If outputs have different scales, normalize them (e.g., L2 normalization) to ensure the metric is meaningful.

4. Compute and interpret

Calculate the metric for pairs of outputs and set a threshold or compare relative values to decide if they are similar.

5. Validate with a small sample

Manually inspect a few pairs to see if the metric aligns with intuitive similarity, adjusting the metric or threshold if necessary.

Key Points to Mention

  • Cosine similarity for directional similarity, especially for embeddings.
  • Euclidean distance for absolute differences, but sensitive to scale.
  • Normalization (e.g., L2) to handle varying magnitudes.
  • Jaccard similarity for set-based outputs (e.g., tokens).
  • Threshold selection based on domain or validation.
  • Limitations: no labels means no ground truth, so it's a heuristic.

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

Q7

Compare Transformer and RNN/LSTM/GRU architectures. For very long sequences, what are the tradeoffs of each in terms of training stability, long-range dependencies, and compute?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

This one I enjoyed.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by contrasting the fundamental mechanisms: RNNs process sequentially with recurrence, while Transformers use self-attention for parallel processing. Then, for long sequences, analyze tradeoffs in training stability, long-range dependencies, and compute, highlighting practical implications for each architecture.

Pro tip: Mention that Transformers' quadratic attention complexity can be mitigated with efficient variants (e.g., sparse attention, Linformer), but these introduce their own tradeoffs; showing awareness of such nuances demonstrates depth.

1. Architectural Overview

Briefly describe RNN/LSTM/GRU and Transformer architectures, emphasizing sequential vs. parallel processing and recurrence vs. attention.

2. Training Stability

Discuss vanishing/exploding gradients in RNNs (mitigated by gating in LSTM/GRU) and Transformers' stability due to residual connections and layer normalization, but note sensitivity to hyperparameters.

3. Long-Range Dependencies

Explain RNNs' difficulty in capturing long-range dependencies due to sequential path, while Transformers directly model all pairwise interactions, but may suffer from attention dilution.

4. Compute and Memory

Compare computational complexity: RNNs O(n) sequential operations, Transformers O(n^2) attention but parallelizable; discuss memory usage and scalability.

5. Practical Tradeoffs and Mitigations

Summarize when to choose each, mentioning techniques like gradient clipping, truncated BPTT for RNNs, and efficient attention mechanisms for Transformers.

Key Points to Mention

  • Vanishing/exploding gradients in RNNs and how LSTM/GRU gates alleviate but don't eliminate the issue.
  • Transformers' self-attention enables direct long-range dependency modeling but has quadratic compute and memory complexity.
  • RNNs process sequentially, limiting parallelism and making training slow on long sequences.
  • Transformers can suffer from attention dilution or loss of focus on very long sequences, requiring positional encodings and possibly sparse attention.
  • Efficient Transformer variants (e.g., Reformer, Longformer) trade off some expressiveness for scalability.
  • Practical considerations: batch size, sequence length, hardware constraints, and task requirements influence architecture choice.

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

Q8

Why can attention mechanisms capture long-range dependencies while vanilla RNNs struggle with them?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

Short answer: attention computes direct pairwise relationships between all positions in one step, so there's no information decay over distance.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the problem: vanilla RNNs process sequentially and rely on backpropagation through time, which causes gradients to vanish or explode over long sequences. Then explain that attention mechanisms compute direct pairwise interactions between all positions, creating shorter gradient paths and allowing the model to focus on relevant parts regardless of distance. Conclude by contrasting the computational and representational trade-offs.

Pro tip: Mention that attention doesn't inherently solve all long-range issues—it can be quadratic in sequence length—but it provides a more direct and parallelizable path to dependencies, which is why it's preferred in practice.

1. Define the challenge

Explain that long-range dependencies require information from distant tokens to influence the current output, which is hard when the signal must pass through many intermediate steps.

2. Explain RNN limitations

Describe how vanilla RNNs process sequentially, causing gradients to vanish or explode during backpropagation through time, making it difficult to learn dependencies beyond a few steps.

3. Describe attention mechanism

Explain that attention computes a weighted sum of all positions, allowing direct connections between any two tokens regardless of distance, and gradients flow through shorter paths.

4. Contrast gradient flow

Highlight that in attention, the path length between any two positions is O(1), while in RNNs it's O(n), which mitigates vanishing gradients and enables learning long-range dependencies.

5. Acknowledge trade-offs

Mention that attention has quadratic complexity in sequence length, but its parallelizability and direct access make it effective for long-range dependencies.

Key Points to Mention

  • Vanishing/exploding gradients in RNNs due to repeated multiplication of Jacobians.
  • Sequential processing in RNNs prevents parallelization and limits effective context.
  • Attention provides direct pairwise interactions, reducing path length between any two positions to O(1).
  • Attention weights are computed based on content, allowing dynamic focus on relevant parts.
  • Gradient flow in attention is more stable because it doesn't involve repeated multiplication through time steps.
  • Trade-off: attention has O(n^2) complexity, but it's often worth it for long-range dependencies.

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

Q9

You have two sets of images, Set A and Set B. How would you test whether they come from the same underlying distribution?

Technical Trade-offsRoot Cause Analysis
Author's notes

Started with pixel-level statistics (mean, variance per channel) as a sanity check, then moved to something more principled.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem: are we comparing raw pixel distributions, feature distributions, or semantic content? Then propose a two-sample statistical test (e.g., MMD, KS test) on appropriate representations, and discuss practical considerations like dimensionality reduction, sample size, and computational trade-offs.

Pro tip: Mention that in real-world ML systems, distribution shift often manifests in model performance degradation, so you'd also monitor downstream metrics as a sanity check. This shows you think beyond pure statistics to production impact.

1. Clarify the comparison level

Determine whether to compare raw pixels, extracted features (e.g., from a pretrained CNN), or high-level semantics. This choice depends on the application and what 'distribution' means in context.

2. Choose a statistical test

Select a two-sample test suitable for high-dimensional data, such as Maximum Mean Discrepancy (MMD) with a kernel, or a classifier two-sample test (C2ST). For lower-dimensional features, consider KS, Anderson-Darling, or energy distance.

3. Address dimensionality and sample size

Apply dimensionality reduction (PCA, UMAP) or use kernel methods to handle high dimensions. Ensure sufficient sample size and consider the test's power and computational cost.

4. Validate with visual and quantitative diagnostics

Use visualizations (t-SNE, histograms) and quantitative metrics (e.g., MMD value, test statistic, p-value) to support the conclusion. Cross-validate with multiple methods to avoid false positives.

5. Relate to model performance and business impact

If the sets are from different distributions, discuss implications for model training, deployment, and monitoring. Suggest mitigation strategies like domain adaptation or retraining.

Key Points to Mention

  • Maximum Mean Discrepancy (MMD) and kernel two-sample tests
  • Classifier two-sample test (C2ST) using a binary classifier's accuracy
  • Kolmogorov-Smirnov (KS) test for low-dimensional features
  • Dimensionality reduction techniques (PCA, t-SNE, UMAP) before testing
  • Multiple testing correction and p-value interpretation
  • Practical considerations: sample size, computational cost, and model performance monitoring

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

Q10

Compare SGD with and without momentum, RMSProp, Adam, and AdamW. When would you prefer AdamW over Adam?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

SGD without momentum is noisy and slow to converge; with momentum it smooths out the gradient updates.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by briefly defining each optimizer and its core mechanism, then compare them along axes like convergence speed, memory, and generalization. Emphasize AdamW's decoupled weight decay and when it outperforms Adam, especially for large models and transfer learning.

Pro tip: Mention that AdamW is the default in many state-of-the-art models like BERT and GPT because it fixes Adam's weight decay implementation, leading to better generalization. Also, note that while AdamW often works well out-of-the-box, SGD with momentum can still win on some vision tasks with proper tuning.

1. Define the optimizers

Briefly explain SGD, SGD with momentum, RMSProp, Adam, and AdamW, highlighting their update rules and key differences.

2. Compare convergence and memory

Discuss how momentum accelerates SGD, RMSProp adapts per-parameter learning rates, and Adam combines both. Note memory overhead: SGD uses O(1), while Adam/AdamW use O(n) for moments.

3. Highlight AdamW's decoupled weight decay

Explain that AdamW decouples weight decay from the gradient update, unlike Adam's L2 regularization, leading to more effective regularization.

4. Discuss generalization and use cases

Mention that AdamW often generalizes better than Adam, especially for transformers and large-scale models. SGD with momentum can still be preferred for CNNs when tuned well.

5. State preference for AdamW

Conclude that AdamW is preferred over Adam when weight decay is important, such as in training deep neural networks with large parameter counts, to avoid overfitting and improve generalization.

Key Points to Mention

  • SGD with momentum: accelerates convergence by accumulating velocity, but requires careful learning rate tuning.
  • RMSProp: adapts learning rates per parameter using moving average of squared gradients, good for non-stationary objectives.
  • Adam: combines momentum and RMSProp, but weight decay is coupled with gradient update (L2 regularization).
  • AdamW: decouples weight decay from gradient update, leading to better regularization and generalization.
  • Memory: SGD uses O(1) memory, Adam/AdamW use O(n) for first and second moments.
  • Use AdamW over Adam when weight decay is crucial, e.g., training transformers, large models, or when overfitting is a concern.

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