Cracking the Machine Learning Interview — Overview

Zhibing Zhao
3 min readAug 14, 2022

Machine learning techniques have been applied in many areas, and machine learning roles are in great need. Machine learning engineers or scientists are usually paid as well as software engineers and sometimes even higher. Machine learning roles are more attractive also because tuning a model is more enjoyable than debugging a program. There have been plenty of resources to help prepare software engineering interviews, e.g., Leetcode. But resources for machine learning interviews are relatively scarce. I have been looking for new opportunities for three months and have taken about twenty technical interviews. This post aims to give people some high-level ideas on how to prepare. I will write about each part in more details later. So follow me if you are interested!

  1. Coding.

Yes, in general you will have to pass at least one coding interview to get an offer. Most of the time you can choose the language you are familiar with but some start-ups may have special requirements. I used Python for all my coding interviews.

Coding interviews for machine learning roles are not as hard as software engineering interviews. If you prepare using Leetcode, medium level problems are usually good enough. I heard people encountered hard problems in interviews but it never happened to me. Some aspects to pay attention to: basic knowledge of objective oriented programing, widely-used data structures (lists, strings, dictionaries, and trees), and some standard algorithms (binary search, recursion, DFS, BFS). Most of the coding interviews I took included binary search. It is a very standard algorithm, and you have to pay attention to details. I have never seen dynamic programing, though I did prepare a little bit for it. I have a post on coding at

2. Machine learning knowledge.

No one knows everything about machine learning, but you will be asked about a number of things that you may have no experience. The good thing is, almost everything can be found online, as long as you know what to learn.

The most basic machine learning problem is probably binary classification. You have to be very familiar about it, including every possible model (logistic regression, decision trees, deep models) and the tradeoffs, all metrics (precision, recall, accuracy, F1 score, AUC), what are the issues if the labels are unbalanced and what can you do.

I have posted an article about binary classification metrics!

For decision trees, you should know random forest, bagging vs boosting, bias and variance tradeoff, how to prevent overfitting, etc.

Deep learning has been developing very fast recently. You will need the knowledge of learning rate, regularization, as well as other method to mitigate overfitting. If you have experience on a specific domain, e.g., natural language processing, you have to know that domain very well (e.g., tf-idf, rnn vs lstm, transformers and bert).

3. System design.

Not every company will ask you to design a system, and therefore I had very limited experience on system design interviews. You should at least know the STAR (Situation, Task, Action, Result) method.

Currently, it is challenging to get an offer because there are fewer opportunities in the market. If you are in the market, keep taking interviews, keep learning, and don’t lose heart. If you are interested in my post, stay tuned! Good luck!

--

--