CrackML by @ml.with.umang
Interview questions / ML Fundamentals
ML Fundamentals interview question

L1 vs L2 Regularization

Compare L1 and L2 regularization and their effect on model parameters.

easyconceptEvidence 34/1001 source reportPinterest

The 60-second answer

L1 penalizes absolute parameter magnitude and can drive coefficients exactly to zero; L2 penalizes squared magnitude and tends to shrink parameters smoothly. L1 can act as feature selection in sparse linear settings, while L2 is stable when correlated features should share weight.

Build the answer in this order

1
Give the core idea

L1 penalizes absolute parameter magnitude and can drive coefficients exactly to zero; L2 penalizes squared magnitude and tends to shrink parameters smoothly.

2
Explain how it works

L1 can act as feature selection in sparse linear settings, while L2 is stable when correlated features should share weight.

3
Compare alternatives

Standardize features before interpreting regularization strength in linear models.

4
State failure modes + validation

Choose the coefficient through validation and discuss elastic net when both sparsity and stability are useful.

A useful interview mental model

This is the shape of a strong answer—not a script to memorize.

01Definition
02Mechanism
03Trade-offs
04Failure modes
05When to use

Senior-level signal

  • Senior answers note that neural-network “weight decay” is not always mathematically identical to adding L2 under adaptive optimizers.
  • Explain how correlated features can make sparse feature-selection interpretations unstable.

What the interviewer is really testing

Mechanistic understanding, assumptions, trade-offs, and whether you can turn a definition into a model decision.

Likely follow-up questions

What assumption makes this approach work?
When would you choose the strongest alternative instead?
What production or data failure mode changes your answer?

Common weak-answer patterns

  • Reciting a definition without mechanism or assumptions.
  • Claiming one technique is always better without a data regime.
  • Stopping before failure modes, validation, or deployment implications.