Machine Learning Engineer Interview Question

What is the difference between SGD with momentum and Adam, and which do you reach for?

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

SGD with momentum uses one global learning rate and accumulates a velocity term to smooth updates. Adam keeps per parameter adaptive rates from running estimates of the first and second moments of the gradient, so it converges fast with little tuning. Adam is the default for transformers and sparse problems; a well tuned SGD with momentum still generalizes better on many vision models.

Why interviewers ask this

Interviewers want to know whether you understand optimizers as mechanisms rather than as string arguments. The discriminator is per parameter adaptivity and what it buys you: robustness to a badly chosen learning rate and to sparse gradients. Strong candidates mention AdamW and why decoupling weight decay matters, plus warmup and schedules, since almost nobody trains a transformer without both.

How to structure your answer

  • Describe what each optimizer keeps in state.
  • Explain what per parameter adaptivity actually buys you.
  • Name your default and the case where you would switch.
  • Mention AdamW, warmup, and the schedule you pair it with.

Example answer

Spoken example, first person

Momentum keeps a running average of past gradients, so the update carries velocity through flat regions and damps oscillation across a ravine. There is still one learning rate for every parameter. Adam adds a second running average, of squared gradients, and divides by its square root, which gives every parameter its own effective step size. Parameters with consistently large gradients get smaller steps, rare features with sparse gradients get bigger ones. In practice that means Adam is much less sensitive to picking the wrong initial learning rate, which is why it is the default for anything transformer shaped and for embedding heavy models. My actual default is AdamW rather than plain Adam, because folding weight decay into the adaptive term makes the decay effectively different per parameter, and decoupling it fixes that. I pair it with linear warmup for a few hundred steps then cosine decay. Where I do switch to SGD with momentum is fine tuning convolutional vision backbones, where a well tuned schedule still tends to land a point or so better on validation accuracy, if I have the budget to tune it.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • Why does Adam need bias correction in the early steps?
  • What exactly does AdamW change relative to Adam?
  • How would you pick an initial learning rate for a model you have never trained?

Related machine learning engineer questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot