← Amazon Interview Insights

Amazon·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Amazon data scientist interview, all technical, no behavioral fluff. They ran through ML fundamentals pretty systematically and I left feeling like I'd done okay on some and fumbled others.

Questions Asked (9)

Q1

Can you explain the bias-variance tradeoff and how it connects to overfitting and underfitting?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

This felt like a warmup but I still managed to ramble.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining bias and variance clearly, then explain how they trade off against each other. Connect high bias to underfitting and high variance to overfitting, and discuss strategies to balance them. Use a concrete example to illustrate the concepts.

Pro tip: Mention that the goal is not to minimize bias or variance alone, but to minimize total error, and that techniques like cross-validation help find the sweet spot. Relate it to Amazon's leadership principles like 'Insist on the Highest Standards' and 'Dive Deep' by emphasizing rigorous model evaluation.

1. Define Bias and Variance

Explain bias as error from erroneous assumptions (e.g., linear model on nonlinear data) and variance as sensitivity to fluctuations in training data.

2. Explain the Tradeoff

Describe how increasing model complexity reduces bias but increases variance, and vice versa. The optimal model balances both to minimize total error.

3. Connect to Overfitting and Underfitting

High bias leads to underfitting (poor on both train and test), high variance leads to overfitting (good on train, poor on test).

4. Discuss Mitigation Strategies

Mention techniques like regularization, cross-validation, ensemble methods, and early stopping to manage the tradeoff.

5. Provide a Concrete Example

Use a polynomial regression example: low degree underfits, high degree overfits, and the right degree balances bias and variance.

Key Points to Mention

  • Bias is error from simplistic assumptions; variance is error from sensitivity to training data.
  • Total error = bias^2 + variance + irreducible error.
  • Underfitting occurs with high bias and low variance; overfitting occurs with low bias and high variance.
  • Regularization (L1/L2) increases bias but reduces variance.
  • Cross-validation helps estimate generalization error and tune hyperparameters.
  • Ensemble methods like bagging reduce variance, boosting reduces bias.

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

Q2

What is regularization and what problem does it solve? Walk me through L1 vs L2 and other approaches like early stopping.

Technical Trade-offsAlgorithms & Data Structures
Author's notes

Went fine.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining regularization as a technique to prevent overfitting by adding a penalty to the loss function, then contrast L1 and L2 in terms of their mathematical forms and effects on weights, and finally discuss other methods like early stopping, dropout, and data augmentation, emphasizing when to use each. Tailor your answer to Amazon by highlighting practical trade-offs and scalability considerations.

Pro tip: Mention that L1 regularization can be used for feature selection due to sparsity, which is valuable in high-dimensional settings, and relate early stopping to saving computational resources—both resonate with Amazon's cost-conscious and scalable ML culture.

1. Define regularization and the problem it solves

Explain that regularization combats overfitting by adding a penalty term to the loss function, discouraging complex models. Mention that it improves generalization to unseen data.

2. Explain L1 regularization (Lasso)

Describe L1 as adding the sum of absolute weights to the loss. Highlight that it produces sparse solutions, effectively performing feature selection, and is useful when you suspect many irrelevant features.

3. Explain L2 regularization (Ridge)

Describe L2 as adding the sum of squared weights to the loss. Note that it shrinks weights smoothly toward zero but rarely to exactly zero, handling multicollinearity well and often improving stability.

4. Compare L1 and L2 and mention Elastic Net

Contrast their effects: L1 for sparsity and feature selection, L2 for weight shrinkage and stability. Mention Elastic Net as a combination that balances both, useful when features are correlated.

5. Discuss other regularization approaches

Cover early stopping (monitor validation error and stop training when it worsens), dropout (randomly deactivate neurons during training), data augmentation, and batch normalization. Explain how each prevents overfitting.

Key Points to Mention

  • Overfitting: model performs well on training data but poorly on unseen data.
  • L1 regularization adds |w| penalty, leading to sparse weights and feature selection.
  • L2 regularization adds w^2 penalty, leading to small but non-zero weights and better conditioning.
  • Elastic Net combines L1 and L2, useful for correlated features.
  • Early stopping: stop training when validation performance degrades, saving computation.
  • Dropout: randomly drop units during training to prevent co-adaptation.

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

Q3

When dealing with imbalanced datasets, which evaluation metrics do you reach for and why? How do accuracy, precision, recall, F1, PR-AUC, and ROC-AUC compare?

Product Analytics & MetricsTechnical Trade-offs
Author's notes

This is where I spent the most time and I think I overcomplicated it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining why accuracy is misleading for imbalanced data, then compare precision, recall, F1, PR-AUC, and ROC-AUC in terms of their sensitivity to class imbalance and alignment with business costs. Conclude with a practical recommendation for metric selection based on the problem context, such as using PR-AUC for highly imbalanced data and F1 when a balance between precision and recall is needed.

Pro tip: Always tie the metric choice to the business cost of false positives versus false negatives—this shows you understand the real-world impact and can communicate with stakeholders. For Amazon, emphasize customer experience and operational efficiency when discussing trade-offs.

1. Highlight the pitfalls of accuracy

Explain that accuracy is misleading for imbalanced datasets because a naive model predicting the majority class can achieve high accuracy but fail to identify the minority class, which is often the class of interest.

2. Define precision, recall, and F1

Describe precision as the proportion of true positives among predicted positives, recall as the proportion of true positives identified, and F1 as the harmonic mean that balances both. Discuss when to prioritize one over the other based on the cost of false positives vs. false negatives.

3. Compare PR-AUC and ROC-AUC

Explain that ROC-AUC plots true positive rate vs. false positive rate and can be overly optimistic for highly imbalanced data because it includes true negatives. PR-AUC focuses on the minority class and is more informative when the positive class is rare.

4. Recommend metrics based on context

Suggest that for highly imbalanced data, PR-AUC is often preferred; for balanced data or when both classes are important, ROC-AUC is fine. Use F1 when a single threshold metric is needed, and consider precision or recall individually if one type of error is more costly.

5. Tie to business objectives

Conclude by linking the metric choice to the specific business problem, such as minimizing false negatives in fraud detection or false positives in recommendation systems, to demonstrate practical understanding.

Key Points to Mention

  • Accuracy is not suitable for imbalanced datasets because it can be high even when the minority class is poorly predicted.
  • Precision and recall trade-off: precision focuses on minimizing false positives, recall on minimizing false negatives.
  • F1 score balances precision and recall, useful when both are important and a single metric is needed.
  • PR-AUC is more informative than ROC-AUC for highly imbalanced datasets because it focuses on the minority class.
  • ROC-AUC can be misleading when the negative class dominates, as it includes true negatives.
  • Metric selection should align with business costs: e.g., in fraud detection, recall might be prioritized to catch all fraud cases.

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

Q4

Define precision and recall with their formulas. In what situations would you prioritize one over the other?

Product Analytics & MetricsTechnical Trade-offs
Author's notes

The classic.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining precision and recall with their formulas, then explain the trade-off between them. Use the confusion matrix to illustrate, and discuss situations where one is prioritized over the other, tying it to business context and costs of errors.

Pro tip: Relate the choice between precision and recall to the specific business problem and the relative costs of false positives versus false negatives. For example, in fraud detection, high recall is often prioritized to catch all fraud cases, even at the expense of more false positives.

1. Define Precision and Recall

Precision = TP / (TP + FP), Recall = TP / (TP + FN). Explain what each metric measures: precision focuses on the accuracy of positive predictions, while recall focuses on capturing all positive instances.

2. Explain the Trade-off

Discuss how increasing precision often decreases recall and vice versa. Mention the precision-recall curve and how threshold adjustment affects both metrics.

3. When to Prioritize Precision

Prioritize precision when the cost of false positives is high. For example, in spam detection, you want to avoid marking important emails as spam.

4. When to Prioritize Recall

Prioritize recall when the cost of false negatives is high. For example, in disease detection, you want to identify all positive cases even if some false positives occur.

5. Consider Business Context and Metrics

Tie the choice to business objectives and consider using F1 score or other metrics when a balance is needed. Discuss how Amazon values customer experience and may prioritize metrics accordingly.

Key Points to Mention

  • Confusion matrix (TP, FP, FN, TN)
  • Precision formula: TP / (TP + FP)
  • Recall formula: TP / (TP + FN)
  • Trade-off and precision-recall curve
  • Cost of false positives vs false negatives
  • F1 score as a harmonic mean of precision and recall
  • Business context and example scenarios (e.g., fraud detection, medical diagnosis)

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

Q5

In logistic regression, what does the model output before you convert it to a probability, and how does that conversion happen?

Algorithms & Data Structures
Author's notes

Log-odds to sigmoid, straightforward.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that the model outputs a linear combination of the input features (the log-odds or logit), then explain that the logistic (sigmoid) function converts this logit into a probability between 0 and 1. Emphasize that the logit is the raw score before any probability transformation, and that the sigmoid is the inverse of the log-odds function.

Pro tip: Mention that the logit is the natural parameter of the Bernoulli distribution and that the sigmoid is its inverse link function—this shows deeper statistical understanding and connects to generalized linear models (GLMs).

1. Define the linear output

State that the model computes a weighted sum of the input features plus a bias term: z = w·x + b. This is the log-odds (logit) of the positive class.

2. Explain the logit interpretation

Clarify that z represents the log-odds: log(p/(1-p)), where p is the probability of the positive class. It can range from -∞ to +∞.

3. Introduce the sigmoid function

Describe the logistic (sigmoid) function: σ(z) = 1 / (1 + e^{-z}). This maps the logit to a probability between 0 and 1.

4. Connect to probability output

Explain that applying σ(z) yields the predicted probability p = P(y=1|x). This is the model's final output after conversion.

5. Mention decision boundary (optional)

If relevant, note that a threshold (e.g., 0.5) on this probability is used for classification, corresponding to z=0.

Key Points to Mention

  • The raw output is a linear combination: z = w·x + b.
  • z is the log-odds (logit) of the positive class.
  • The sigmoid function σ(z) = 1/(1+e^{-z}) converts logit to probability.
  • The sigmoid is the inverse of the log-odds function.
  • The output probability is P(y=1|x).
  • Logistic regression is a generalized linear model with a logit link function.

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

Q6

What does a ROC-AUC of 0.8 actually mean intuitively, and what's a caveat you'd flag?

Product Analytics & MetricsTechnical Trade-offs
Author's notes

I like this question because the intuitive framing (if you pick a random positive and a random negative, the model ranks the positive higher 80% of the time) is genuinely useful and not everyone knows it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by giving an intuitive explanation of ROC-AUC as the probability that a randomly chosen positive example is ranked higher than a randomly chosen negative example. Then discuss what 0.8 means in practical terms (good but not perfect discrimination) and flag a key caveat such as class imbalance or the fact that AUC is threshold-independent and may not reflect business costs.

Pro tip: Mention that AUC is insensitive to class distribution but can be misleading when the positive class is rare, and that for imbalanced problems, precision-recall AUC is often more informative. Also, tie the metric to business impact by discussing how threshold choice affects precision and recall.

1. Define ROC-AUC intuitively

Explain that ROC-AUC is the probability that a randomly selected positive instance is ranked higher than a randomly selected negative instance by the model. It measures the model's ability to discriminate between classes across all thresholds.

2. Interpret the value 0.8

State that 0.8 indicates good discriminatory power: 80% chance of correctly ranking a random positive above a random negative. It's better than random (0.5) but not perfect (1.0).

3. Discuss practical implications

Explain that in practice, 0.8 might be acceptable depending on the problem, but the optimal threshold depends on business costs and benefits. AUC alone doesn't tell you how well the model performs at a specific threshold.

4. Flag a key caveat

Choose one caveat to highlight, such as: AUC can be misleading with severe class imbalance, it ignores predicted probabilities (only ranks), or it doesn't reflect business costs. For Amazon, emphasize class imbalance or cost-sensitivity.

5. Suggest alternatives or complements

Mention that for imbalanced data, precision-recall AUC or F1-score might be more informative. Also, consider lift curves or cost curves to align with business objectives.

Key Points to Mention

  • ROC-AUC is threshold-independent and measures ranking quality.
  • 0.8 means 80% chance of correctly ranking a random positive above a random negative.
  • AUC is insensitive to class imbalance, which can be a problem when positives are rare.
  • Precision-recall AUC is often better for imbalanced datasets.
  • AUC doesn't reflect business costs or the actual threshold used in production.
  • Always relate the metric to the specific business problem and costs.

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

Q7

What are ensemble models and why do they tend to outperform individual models?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Talked through bagging vs boosting at a high level and said something about variance reduction for bagging and bias reduction for boosting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining ensemble models and explaining the core idea of combining multiple base models to reduce variance and bias. Then describe the main types (bagging, boosting, stacking) and why they outperform individual models, using concrete examples. Finally, connect to Amazon's scale and the trade-offs involved in production.

Pro tip: Emphasize that ensembles are not a free lunch: they add computational cost and complexity, so you should discuss when they are worth it, such as when accuracy is critical and latency is less constrained. Mention that at Amazon, ensembles are often used in offline or batch settings where the extra cost is justified.

1. Define ensemble models

Explain that ensemble models combine predictions from multiple base models to produce a single, more robust prediction. The key idea is that a group of weak learners can form a strong learner.

2. Describe main ensemble techniques

Briefly cover bagging (e.g., Random Forests), boosting (e.g., XGBoost, AdaBoost), and stacking (meta-learning). Mention how each reduces variance or bias differently.

3. Explain why they outperform individual models

Discuss the bias-variance trade-off: bagging reduces variance by averaging, boosting reduces bias by sequentially correcting errors, and stacking leverages diverse model strengths. Also mention that ensembles are less likely to overfit and more robust to noise.

4. Connect to Amazon context and trade-offs

Relate to Amazon's use cases: e.g., product recommendations, fraud detection, demand forecasting. Highlight trade-offs: increased training/inference cost, latency, and interpretability, and when to choose ensembles over simpler models.

Key Points to Mention

  • Bias-variance decomposition and how ensembles address each component
  • Bagging (parallel) vs. boosting (sequential) vs. stacking (meta-learner)
  • Random Forests and Gradient Boosting as popular examples
  • Theoretical foundations: Condorcet's Jury Theorem, error correlation, diversity
  • Trade-offs: computational cost, latency, interpretability, and maintenance
  • Amazon-specific applications: personalization, fraud detection, supply chain

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

Q8

For tree-based models like decision trees, random forests, and gradient boosting, what are the key hyperparameters and how do they push the model toward higher bias or higher variance?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Tree depth and number of estimators came to mind immediately.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining bias and variance in the context of tree-based models, then systematically discuss key hyperparameters for each model type, explaining how each hyperparameter influences the bias-variance trade-off. Use concrete examples to illustrate the effects and conclude with practical tuning strategies.

Pro tip: Emphasize that hyperparameter tuning is not just about minimizing error but also about understanding the underlying data structure and computational constraints; mention that in practice, you often start with a strong baseline like XGBoost with default parameters and then tune the most impactful ones.

1. Define Bias and Variance

Briefly explain bias as underfitting (model too simple) and variance as overfitting (model too complex), and how they relate to the bias-variance trade-off.

2. Decision Trees Hyperparameters

Discuss max_depth, min_samples_split, min_samples_leaf, and max_features, explaining how increasing depth or reducing minimum samples increases variance, while limiting them increases bias.

3. Random Forests Hyperparameters

Cover n_estimators, max_features, and max_depth, noting that more trees reduce variance without increasing bias, while max_features controls the correlation between trees and thus variance.

4. Gradient Boosting Hyperparameters

Explain learning_rate, n_estimators, max_depth, subsample, and regularization terms (lambda, alpha), and how they control the trade-off: lower learning rate with more trees reduces variance, deeper trees increase variance.

5. Practical Tuning Strategies

Summarize how to tune these hyperparameters using cross-validation, grid search, or Bayesian optimization, and mention that the goal is to find the sweet spot that minimizes validation error.

Key Points to Mention

  • Bias-variance trade-off: underfitting vs overfitting
  • Decision tree: max_depth, min_samples_split, min_samples_leaf, max_features
  • Random forest: n_estimators, max_features, bootstrap, max_depth
  • Gradient boosting: learning_rate, n_estimators, max_depth, subsample, regularization
  • Effect of hyperparameters: increasing complexity typically increases variance and decreases bias
  • Practical tuning: cross-validation, grid search, early stopping

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

Q9

Compare sigmoid and softmax activations. When do you use each, and how do their outputs differ?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Sigmoid for binary or multi-label, softmax for mutually exclusive multiclass.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining each activation function mathematically and explaining their distinct purposes: sigmoid for binary classification and softmax for multi-class. Then compare their output properties (range, sum, interpretation) and discuss when to use each, including trade-offs like computational cost and probability calibration. Finally, mention practical considerations such as numerical stability and common pitfalls.

Pro tip: Emphasize that softmax is essentially a generalization of sigmoid to multiple classes, and that using sigmoid for multi-class problems (one-vs-rest) can lead to probabilities that don't sum to 1, which is often undesirable. Also, note that softmax is not scale-invariant and can be sensitive to outliers, so techniques like log-softmax are used for stability.

1. Define sigmoid and softmax

Provide the mathematical formulas: sigmoid(x) = 1/(1+e^{-x}) and softmax(x_i) = e^{x_i}/Σ_j e^{x_j}. Explain that sigmoid squashes each input independently to [0,1], while softmax normalizes a vector of inputs into a probability distribution.

2. Compare output properties

Highlight that sigmoid outputs are independent and do not sum to 1, whereas softmax outputs sum to 1 and represent a categorical distribution. Mention that softmax is invariant to adding a constant to all inputs, while sigmoid is not.

3. Discuss use cases

Explain that sigmoid is used for binary classification (one output node) or multi-label classification (multiple independent binary outputs), while softmax is used for multi-class classification (mutually exclusive classes).

4. Address trade-offs and practical considerations

Talk about computational complexity: softmax requires computing exponentials and a sum over all classes, which can be expensive for large numbers of classes. Mention numerical stability issues (e.g., overflow) and solutions like subtracting the max input. Also note that sigmoid can suffer from vanishing gradients, while softmax combined with cross-entropy loss provides well-behaved gradients.

5. Summarize with a decision rule

Conclude with a clear rule: use sigmoid when each output is an independent binary decision; use softmax when outputs are mutually exclusive and you need a probability distribution over classes.

Key Points to Mention

  • Sigmoid outputs are independent probabilities in [0,1]; softmax outputs form a probability distribution summing to 1.
  • Sigmoid is for binary or multi-label classification; softmax is for multi-class classification.
  • Softmax is a generalization of sigmoid to multiple classes (for 2 classes, softmax reduces to sigmoid).
  • Computational cost: softmax requires a sum over all classes, which can be costly for large output spaces.
  • Numerical stability: softmax can overflow; use log-softmax or subtract max for stability.
  • Gradient behavior: sigmoid can cause vanishing gradients; softmax with cross-entropy loss has nice gradient properties.

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