ML & Deep Learning Foundations·Question 12 of 55Basic

What is feature scaling? Compare normalization and standardization, and tell me which models actually need it.

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Standardization subtracts the mean and divides by the standard deviation, giving roughly zero mean and unit variance with an unbounded range. Min-max normalization rescales linearly into a fixed range, usually [0, 1]. Standardization is the default; min-max is for when something downstream needs a bounded range, and it is far more sensitive to outliers because one extreme value squashes everything else.

Full worked answer

Standardization subtracts the mean and divides by the standard deviation, giving roughly zero mean and unit variance with an unbounded range. Min-max normalization rescales linearly into a fixed range, usually [0, 1]. Standardization is the default; min-max is for when something downstream needs a bounded range, and it is far more sensitive to outliers because one extreme value squashes everything else.

Who needs it:

  • Distance-based methods (kNN, k-means, SVM with an RBF kernel): a feature measured in dollars will dominate one measured in fractions purely through units.
  • Regularized linear models: an L1/L2 penalty is scale-dependent, so an unscaled feature gets an arbitrary amount of shrinkage.
  • PCA: it maximises variance, and variance is unit-dependent, so without standardizing you get the components of whatever column has the biggest numbers.
  • Gradient descent on linear models and neural nets: wildly different feature scales make the loss surface badly conditioned, and optimization zig-zags.

Who does not: decision trees and tree ensembles. Splits are thresholds, so any monotone transform of a feature leaves the model unchanged.

Two things that get candidates cut here. First, fit the scaler on train only, then apply to validation and test. Fitting on the full dataset before splitting is textbook leakage and it is the most common one people commit. Second, the fitted statistics are part of the model artifact. Recomputing the mean and standard deviation from a serving batch, or defaulting to zero where training imputed a median, is training-serving skew, and it fails silently.

For skewed positive quantities (income, counts, latency) I would log-transform first, then standardize. For heavy tails, robust scaling on median and IQR. In deep nets, input scaling matters less internally because normalization layers handle activations, but the inputs themselves still need it.

What a good answer covers

  • Standardization subtracts the mean and divides by the standard deviation, giving roughly zero mean and…
  • Min-max normalization rescales linearly into a fixed range, usually [0, 1]
  • Standardization is the default; min-max is for when something downstream needs a bounded range, and it…
  • Distance-based methods (kNN, k-means, SVM with an RBF kernel)
  • Regularized linear models

Key terms: Distance-based methods · Regularized linear models · PCA · part of the model artifact

Interviewer follow-ups to expect

  1. Why does an unscaled feature ruin L2 regularization but not L1's sparsity property in the same way?

  2. Where in a PyTorch serving path would you put the scaler so it cannot drift from training?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep