← Amazon Interview Insights

Amazon·Machine Learning Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
Jun 2026Remote

Summary

Phone screen for an ML engineer role at Amazon, pure conceptual stuff, no coding. Five topics back to back and the interviewer kept pushing on the 'why' behind every answer, which is where I started to sweat a little.

Questions Asked (5)

Q1

What are the main assumptions of linear regression, and why is squared loss the standard choice?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

I listed the assumptions fine but fumbled the classification part.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly listing the main assumptions of linear regression (linearity, independence, homoscedasticity, normality of errors, no multicollinearity) and briefly explain each. Then, justify squared loss by connecting it to the Gauss-Markov theorem, maximum likelihood under Gaussian errors, and its convex optimization properties. Finally, mention practical implications and alternatives like robust regression when assumptions are violated.

Pro tip: Emphasize that squared loss is not just a convention—it's theoretically grounded in the Gauss-Markov theorem and MLE, but also acknowledge its sensitivity to outliers and when to consider alternatives like Huber loss. This shows you understand both theory and practical trade-offs, which is crucial at Amazon.

1. List the assumptions

Enumerate the key assumptions: linearity, independence of errors, homoscedasticity, normality of errors, and no perfect multicollinearity. Briefly explain each in one sentence.

2. Explain why squared loss is standard

Discuss the Gauss-Markov theorem: under the assumptions, OLS (squared loss) gives the best linear unbiased estimator (BLUE). Also mention that minimizing squared loss is equivalent to maximum likelihood estimation when errors are Gaussian.

3. Highlight mathematical and computational benefits

Note that squared loss leads to a convex optimization problem with a closed-form solution (normal equations), making it efficient and stable to compute.

4. Discuss limitations and alternatives

Acknowledge that squared loss is sensitive to outliers and that assumptions may not hold in practice. Mention alternatives like robust regression (Huber loss) or quantile regression when appropriate.

5. Connect to practical ML engineering

Relate to real-world scenarios: when to use linear regression, how to check assumptions (residual plots, tests), and the impact on model performance and interpretability.

Key Points to Mention

  • Linearity: The relationship between predictors and response is linear.
  • Independence: Errors are uncorrelated (no autocorrelation).
  • Homoscedasticity: Constant variance of errors across all levels of predictors.
  • Normality: Errors are normally distributed (needed for inference, not for BLUE).
  • No multicollinearity: Predictors are not perfectly correlated.
  • Gauss-Markov theorem: OLS is BLUE under assumptions.
  • Maximum likelihood: Squared loss corresponds to Gaussian errors.
  • Convexity and closed-form solution: Efficient optimization.
  • Sensitivity to outliers: Squared loss penalizes large errors heavily.

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

Q2

What is logistic regression, and why does the logarithm show up in its formulation?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I answered the log-likelihood part fine but blanked for a second on the two distinct places where a log appears.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining logistic regression as a linear model for binary classification that outputs probabilities via the sigmoid function. Then explain that the logarithm arises from the log-odds (logit) link function, which linearizes the relationship between features and the probability of the positive class. Finally, connect this to maximum likelihood estimation and the cross-entropy loss.

Pro tip: Emphasize that the log-odds interpretation makes coefficients interpretable as additive effects on the odds, which is crucial for explainability in production systems. Also, mention that logistic regression is a foundational building block for neural networks and is widely used at Amazon for its simplicity and scalability.

1. Define logistic regression

State that logistic regression is a supervised learning algorithm for binary classification that models the probability of the positive class using a linear combination of features passed through a sigmoid function.

2. Introduce the sigmoid and log-odds

Explain that the sigmoid squashes the linear output to [0,1], and its inverse is the log-odds (logit) function: log(p/(1-p)). This shows that the log-odds is linear in the features.

3. Derive from maximum likelihood

Describe how maximizing the likelihood of the data under the Bernoulli model leads to the cross-entropy loss, which naturally involves logarithms of the predicted probabilities.

4. Explain why logarithm appears

Summarize that the logarithm appears because we model the log-odds as a linear function, and because the likelihood of binary outcomes involves log probabilities, making optimization tractable.

5. Connect to practical implications

Mention that this formulation yields interpretable coefficients (additive effects on log-odds), convex loss for efficient optimization, and probabilistic outputs useful for decision-making.

Key Points to Mention

  • Logistic regression models the probability of the positive class using the sigmoid function.
  • The logit (log-odds) function is the inverse of the sigmoid and linearizes the relationship.
  • The logarithm arises from the log-odds link and from maximum likelihood estimation (cross-entropy loss).
  • Coefficients represent additive effects on the log-odds, which can be exponentiated to odds ratios.
  • The loss function is convex, ensuring global convergence with gradient-based methods.
  • Logistic regression is a fundamental algorithm for binary classification and a building block for more complex models.

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

Q3

What is a random forest, and how does the feature selection work at each split during tree construction?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Pretty comfortable here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining a random forest as an ensemble of decision trees trained on bootstrapped samples with random feature subsets. Then explain the feature selection at each split: at each node, a random subset of features is considered, and the best split is chosen based on impurity reduction (e.g., Gini or entropy). Emphasize how this randomness reduces correlation among trees and improves generalization.

Pro tip: Mention that the number of features considered at each split (often denoted mtry or max_features) is a key hyperparameter; in practice, for classification, sqrt(p) is common, while for regression, p/3 is often used. Also note that feature selection at splits is not about selecting a global feature set but about local, randomized selection to decorrelate trees.

1. Define Random Forest

Explain that it's an ensemble learning method that builds multiple decision trees and aggregates their predictions (voting for classification, averaging for regression).

2. Describe Tree Construction

Each tree is trained on a bootstrap sample of the data, and at each node, a random subset of features is selected as candidates for splitting.

3. Explain Split Selection

From the random feature subset, the algorithm chooses the feature and threshold that maximize impurity reduction (e.g., Gini impurity or information gain).

4. Highlight Randomization Benefits

This random feature selection decorrelates trees, reducing variance and preventing overfitting compared to individual decision trees.

5. Mention Hyperparameters

Discuss key hyperparameters like number of trees, max_features (features per split), and max_depth, and their impact on performance.

Key Points to Mention

  • Bootstrap aggregating (bagging) and random feature subspace method
  • Impurity measures: Gini impurity, entropy, or variance reduction
  • Random subset size (max_features) and its typical values (sqrt(p) for classification, p/3 for regression)
  • Reduction of correlation among trees leading to lower variance
  • Out-of-bag error as a validation method
  • Comparison to bagging: random forest adds feature randomness at splits

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

Q4

Explain the Adam optimizer and compare it to vanilla SGD. What are the real trade-offs?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

This one I over-explained.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly explaining Adam's mechanism (momentum + adaptive learning rates) and vanilla SGD's simplicity. Then compare them across key dimensions like convergence speed, generalization, and hyperparameter sensitivity, and discuss real-world trade-offs in production ML systems. Finally, tie it back to practical scenarios, especially at scale like Amazon.

Pro tip: Emphasize that Adam often converges faster but can generalize worse than SGD with momentum, and mention that switching from Adam to SGD late in training can combine fast convergence with better final performance—a trick used in many winning Kaggle solutions and production systems.

1. Define Adam and SGD

Briefly explain vanilla SGD (updates parameters using a fixed learning rate times gradient) and Adam (combines momentum and RMSProp with bias correction). Highlight that Adam maintains per-parameter learning rates.

2. Compare mechanisms

Contrast how SGD uses a single global learning rate, while Adam adapts learning rates based on first and second moment estimates. Mention that Adam includes bias correction for initial steps.

3. Discuss convergence and generalization

Explain that Adam typically converges faster and is less sensitive to learning rate, but SGD with momentum often achieves better generalization on many tasks, especially in computer vision.

4. Highlight practical trade-offs

Cover memory overhead (Adam stores two additional states per parameter), computational cost, and hyperparameter tuning. Note that Adam can fail to converge on some problems due to adaptive learning rates.

5. Relate to production context

Tie to Amazon-scale scenarios: Adam is often preferred for quick prototyping and NLP tasks, while SGD might be used for large-scale recommendation systems where generalization and memory matter.

Key Points to Mention

  • Adam combines momentum and adaptive learning rates (RMSProp) with bias correction.
  • Vanilla SGD uses a single learning rate and no momentum, making it simple but sensitive to tuning.
  • Adam converges faster and requires less hyperparameter tuning, but can generalize worse than SGD with momentum.
  • Adam has higher memory and compute overhead due to storing first and second moment estimates.
  • Switching from Adam to SGD during training can yield better final performance.
  • In production, choice depends on task, scale, and resource constraints (e.g., NLP vs. CV, memory limits).

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

Q5

Between a narrow two-layer network and a wide two-layer network, which is more likely to get stuck in a poor local minimum, and why?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

Said the narrow one, which is right, but my first explanation leaned too hard on 'fewer parameters means fewer solutions' without really articulating the loss landscape argument.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First clarify that the question is about the loss landscape and optimization dynamics of two-layer networks. Then argue that narrow networks are more prone to poor local minima due to their limited capacity and highly non-convex loss surface, while wide networks have fewer bad local minima and are easier to optimize. Support your answer with theoretical insights and practical implications.

Pro tip: Mention that in practice, width often matters more than depth for avoiding poor local minima, and relate this to the success of overparameterized models in deep learning. Also, note that narrow networks may require more careful initialization and training tricks to escape suboptimal solutions.

1. Define the networks

Clarify what is meant by 'narrow' and 'wide' two-layer networks: narrow has few hidden units, wide has many. Emphasize that both are two-layer (one hidden layer) feedforward networks.

2. Explain loss landscape

Discuss how the loss landscape of a narrow network is more rugged with many poor local minima, while a wide network has a smoother landscape with fewer bad local minima and more saddle points.

3. Connect to optimization

Explain that gradient-based methods can get trapped in poor local minima in narrow networks, but in wide networks, saddle points are the main obstacle and can be escaped more easily.

4. Provide theoretical support

Cite results from optimization theory and deep learning: e.g., overparameterized networks have no bad local minima (under certain conditions), and wider networks have better conditioning.

5. Conclude and relate to practice

Conclude that narrow networks are more likely to get stuck in poor local minima. Mention practical implications: wider networks are easier to train and often generalize better despite overparameterization.

Key Points to Mention

  • Narrow networks have limited capacity and a highly non-convex loss surface with many poor local minima.
  • Wide networks have a smoother loss landscape with fewer bad local minima and more saddle points.
  • Saddle points are easier to escape than poor local minima in high-dimensional spaces.
  • Overparameterization in wide networks can eliminate bad local minima under certain conditions.
  • Initialization and optimization algorithms (e.g., SGD with momentum) interact differently with narrow vs. wide networks.
  • Practical observation: wider networks often train faster and achieve better performance, partly due to easier optimization.

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