Explain core ML fundamentals

Quick Overview

Explain core ML fundamentals evaluates core ML concepts, assumptions, math intuition, training/evaluation trade-offs, and practical failure modes in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Explain core ML fundamentals

Company: Amazon

Role: Software Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Technical Screen

Compare L1 versus L2 regularization, including their effects on sparsity, optimization geometry, and robustness to outliers. Explain how to choose loss functions for regression/classification (e.g., MSE, MAE, logistic/cross-entropy) and discuss gradient properties. Describe PCA’s objective (variance maximization vs. reconstruction error), fitting/transform steps, and selecting the number of components. Explain how Random Forests are trained, their bias–variance trade-off, limits of impurity-based feature importance, and key hyperparameters.

Overview: Explain core ML fundamentals evaluates core ML concepts, assumptions, math intuition, training/evaluation trade-offs, and practical failure modes in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

|Home/Machine Learning/Amazon
Amazon logo
Amazon
Jul 15, 2025
mediumSoftware EngineerTechnical ScreenMachine Learning
7
0

Explain core ML fundamentals

Machine Learning Fundamentals: Regularization, Losses, PCA, and Random Forests

Assume standard supervised learning with linear models for regression/classification, PCA for dimensionality reduction, and Random Forests for tabular data. Answer the following:

1) L1 vs. L2 Regularization

Compare L1 (Lasso) and L2 (Ridge) regularization in terms of:

  • Sparsity of learned coefficients
  • Optimization geometry and differentiability
  • Robustness to outliers (clarify what kind of outliers and how the penalty interacts with the loss)

2) Choosing Loss Functions and Gradient Properties

Explain how to choose loss functions for:

  • Regression: MSE vs. MAE (and mention Huber if relevant)
  • Classification: logistic/cross-entropy (and note hinge/focal if relevant) Discuss their gradient properties, optimization behavior, and sensitivity to outliers.

3) PCA

Describe PCA’s objective (variance maximization vs. reconstruction error minimization), the fitting and transform steps, and how to select the number of components.

4) Random Forests

Explain how Random Forests are trained, their bias–variance trade-off, the limits of impurity-based feature importance, and key hyperparameters (with brief tuning guidance).

Clarifying Questions to Ask Guidance

  • Clarify the task, data shape, labels, constraints, and evaluation metric.
  • State assumptions behind the math or modeling technique you choose.
  • Connect theory to practical training, debugging, and deployment implications.

What a Strong Answer Covers Guidance

  • Correct definitions and formulas where the prompt requires them.
  • A practical explanation of how the method behaves on real data.
  • Trade-offs, failure modes, diagnostics, and mitigation strategies.
  • Evaluation choices that match the product or modeling objective.

Follow-up Questions Guidance

  • How would noisy labels, class imbalance, or distribution shift affect the answer?
  • What would you monitor after deployment?
  • Which baseline would you compare against first?
Loading comments...