internalsGet Pro

Module 19 · Lesson 3 of 9Pro

ML coding interviews: implementing from scratch

Level
Intermediate
Topic
Machine learning engineering interviews
Reading time
16 min

When you finish this page you can

  1. Plan a 45-minute from-scratch coding round in five phases, and say what each phase shows the interviewer.
  2. Write k-means in NumPy with stated shapes, a stop rule and a choice for empty clusters, then test it on a case you can check by hand.
  3. Answer a scale follow-up with memory arithmetic and a chunked distance calculation.
  4. Name the trap an interviewer will probe in softmax, logistic regression, top-k and ROC-AUC tasks.

Builds on 3 lessons

Start with lesson 114 min
  1. ML engineering interviews: what companies test14 min
  2. k-means: grouping similar data points14 min
  3. NumPy: arrays and vectorized maths14 min

The code ran, and the round still went badly

, our example online store, now serves 5 million customers a day and is hiring ML engineers. Farah, an ML engineer on its ML team, runs one interview round: implement a model from scratch in NumPy, in 45 minutes. Today’s task is , the algorithm that groups customers around k centres.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan