Codementor Events

Preparing for Machine Learning Interviews

Published Mar 18, 2019Last updated Mar 19, 2019
Preparing for Machine Learning Interviews

Data scientist , Machine Learning Engineer, Deep Learning Engineer , AI Engineer, Machine Learning researcher are some of the fancy jobs of 21st century and their are a lot of job openings around it too. Given the vast breadth of AI domain, it is very difficult to learn everything before an interview. Having failed a lot of interviews due to lack of awareness about what should be prepared for what kind of an interview so i would be talking about how the above mentioned roles are different and what should be prepared for what kind of roles. The appropriate audience for this blog would be the ones having 0 - 2 years industry experience.

Broadly speaking there are 2 kinds of roles in Data Science : Research Roles and Engineering Roles. Research roles expect you to be very clear with the mathematics behind everything whereas engineering roles expect you to productionize models, scale them and basically build robust models. Some companies expect you to be prepared for both and there are some common concepts that people should be familiar with while interviewing for both roles. Let’s talk about the topics to be pondered upon in a little more detail.

1) Data Structures
In most of the companies one or more rounds will test your data structure and algorithms knowledge and the difficulty will depend on the level of company. Everyone should be clear with basic questions of arrays, strings, linked-lists, trees, dynamic-programming, stacks, queues. If you do competitive programming as a hobby this shouldn't be a problem for you otherwise you can go through and understand the working of the famous problems from each of the above-mentioned topics.

2) Machine/Deep Learning basics
"Basics" is a very vague and relative term so I’ll list down some topics which you must be familiar with.
a) Bias/Variance Trade-off (Very important)
b) Precision/Recall Definitions and everything around it. (Be ready with some examples and use cases)
c) Gradient descent (with the maths and intuition behind it)
d) Regularization (L1, L2, Dropouts)
e) Backpropagation (with maths and intuition behind it)
f) Be clear with a certain level of understanding what is clustering, classification, regression and dimensionality reduction. Also have an high level idea of the famous algorithms under each of the above topics.

3) Programming Language (I'll talk about Python)
Being familiar with how python works, the best practices, using different data structures which are in-built in python, concepts around object-oriented programming in python, mutable and immutable objects, strings, how is "is" and "==" different and similar stuff. How is hash function implemented in python, what are the hashable and un-hashable data structures with reason, writing and understanding list comprehensions, iterators, generators and decorators and how are they implemented.
Fun question example(This is a real interview question):

  def foo(x = []):
      x.append(1)
      return x
  print(foo())
  print(foo())

What would be the output of this?

4) Problem Solving Ability
This section may or may not be in the interview process. But in some interviews this round could be a bottleneck if you are working on the Engineering side more. This type of round basically involves questions around modelling a scenario from scratch. For example : How do you model a system where you want to detect fraud in credit cards? Now for such type of questions you are expected to think about the features you will choose with reasoning , the model(which and why) you will use, the metrics you will define and sometimes how will you productionize it.

5) Research Roles(Not the one which require Masters or PHD)
You should be familiar with the mathematics and all the intuitions behind all the basic machine learning concepts and the concepts behind the projects you have mentioned in your resume. I'll give you some examples below what could be expected and what level of detail about a specific concept can be expected.

Now lets say you have something related to object detection so you should be clear with every detail of whatever you have mentioned in your project. Some of the things you should be absolutely clear about is the mathematical intuition behind convolution and the actual maths also, how is object detection model trained, what is the history of models that are used in object detection like Fast RCNN, Faster RCNN, mask RCNN , etc and why have we moved from one model to another. You should also be clear about different pooling techniques and when to use what. I hope this gives you an idea to what level and details can research interviews go.

The above was an example of how deep can interviewers go in a research related field. You are also expected to know the math behind the basics of the Machine Learning like what is the mathematical formula of Bias.

6) Engineering Roles(in ML team)
This type of role would require a good knowledge of how to serve models in production and the challenges behind it. Knowledge of how to scale the models and big data pipelines would be big plus here. Previous experience in productionizing and deploying the models is essential and will help you answers different scenarios given by the interviewer. You could also be asked to write some basic API functions for given scenario like how will you improve the value retrieval of a particular key from a large database if the service is not able to meet the SLA's.

Lastly, you should be very clear in explaining your projects because there is a lot of scope of mis-understanding in this domain.

If you are wondering that statistics is not mentioned anywhere, i believe core statistics is asked in an more Analyst type of a role or is job description specific.

Resume Building is another important aspect of getting shortlisted for the data science interviews. I would be talking about it in another blog.

PS - This is my take on data science interviews and does not guarantee you jobs, it just increases the likelihood of you performing better at data science interviews.

Credits - Nathan W Pyle for the illustration !

Discover and read more posts from Akash Basudevan
get started
post commentsBe the first to share your opinion
Sara EL-ATEIF
5 years ago

Thank you 🙏

Luke Rolka
5 years ago

You may want to credit Nathan W Pyle for the illustration in this article.

Akash Basudevan
5 years ago

Absolutely. My bad for not doing that earlier!

Show more replies