Be Ready for These 13 Interview Questions About Machine Learning
Machine Learning Interview Questions
The interview for a machine learning engineer is going to be very technical, but it's your chance to show what makes you the best candidate.
Get prepared with these artificial intelligence and machine learning interview questions and how to answer them.
Interviewers can also use this list to build an interview that reveals the ability of machine learning candidates. You’ll learn their technical skills and their ability to think critically.
Be prepared to show off your knowledge of shallow learning algorithms. Unless you’re applying for a strict Data Scientist position, the interviewer isn’t going to go into too much nitty-gritty with algorithm questions. But you should be able to talk about the inputs and what algorithms are best used for what application.
1. When would you use KNN (k nearest neighbors)?
KNN is usually used for classification. It’s one of the simplest and most used algorithms in machine learning.
Your answer might vary based on your experience but I would consider KNN in most cases when the classes and features are labelled
2. Describe how SVM (Support Vector Machine) works. How can you use SVMs with non-linear data?
SVM creates a hyperplane or decision boundary to classify input data based on which side of the boundary the new data lies. They are optimized by increasing the margin between the boundary and data points as much as possible.
Remember that kernels are often stacked with SVMs. Kernels transform non-linear data into linear data so that an SVM can be optimized.
Frameworks and Languages
The interviewer will want to know what languages and frameworks you have used. They will also use these questions to get an idea of how quickly you will pick up a new framework and how in tune you are with what frameworks are available for artificial intelligence.
3. Why do you like using <language from your resume>?
Anything on your resume is fair game. Especially the programming languages you list in your skills. So be prepared to talk about all the ins and outs.
If the truthful answer is that you only used that language because that's what they used at your last job, that's fine. Just be prepared to talk about the advantages and disadvantages of a language from a machine learning perspective.
4. Tell me about your experience using <framework the company uses>?
If you are familiar with the framework the company uses, this should be easy for you. Certainly, if you listed them on your resume you should be able to talk all about them.
If you haven’t used that specific framework much that’s not necessarily a deal-breaker. Any software engineer worth his/her salt should be able to adapt to new a framework without a huge learning curve. The job description will likely list a few of the main platforms the company uses. Do your research on those before the interview starts.
Some aspects to focus on when researching a new framework:
What tasks does it handle best?
What are the strengths/weaknesses?
Which languages interface well with the framework?
You need to be able to talk intelligently about that environment.
If the framework is open-source then try it out on your personal computer. There’s also some affordable online classes you can take that will give you a temporary license.
Building Neural Networks
5. What would you do if your algorithm doesn’t converge?
This is an open-ended question that should be easy for anyone working in machine learning.
Decreasing the learning rate (alpha) is a good first step. As an interviewer, I’d like to see the candidate describe a more logical approach to finding alpha. Try a strategic range of alphas and plot the cost function over number of iterations.
6. When would you use Gradient Descent vs Normal Equation?
You might asked about the pros and cons of different methods to optimize an algorithm.
Remember that the normal equation can’t be used with classification, so this comparison only matters for regression. The normal equation is chosen when the number of features isn’t very large. It has an advantage over gradient descent in that you don’t have to choose a learning rate or iterate.
If there are a lot of features then the normal equation is very slow so I would choose gradient descent.
Evaluating Models (Performance)
One of the primary jobs of a machine learning engineer is to optimize a neural network and understand how well it performs.
7. Why is overfitting bad and how can you fix it?
Overfitting is when an algorithm fits training data very well but does accurately predict new situations. Obviously this is bad because it’s not useful for real world situations.
Describe a few ways that overfitting can be improved. Adding a regularization term and increasing lambda can have good results. Decreasing the number of features or reducing the order of polynomials are options but aren’t the right choices in every situation.
8. How do you know if your model is good?
This is similar to the above question where the candidate needs to understand how to evaluate models.
You can explain how available training data is split up into Training Data, Validation Data and Test Data and what each is used for. I’d want to hear a candidate talk about varying the polynomial degree and lambda and comparing the error in the validation data.
Come to the interview ready to discuss previous projects. As with any interview, anything on your resume is fair game.
Have a portfolio of projects from work, school or your personal use ready. You might be restricted in what you can say from a Non-Disclosure Agreement or classified work so be clear on what you can discuss.
Here are some questions you can expect:
9. What was your favorite machine learning project you worked on?
For the sake of this interview you might pick the project most relevant to the job as your favorite. This will give you a chance to highlight your relevant experience.
If you’d rather talk about which one was your actual favorite to give the hiring manager an idea of whether you’ll like the new position that’s a good idea too.
10. Tell me about a tough problem you solved.
Pick a problem that can be easily described. Part of answering this question well is showing that you can describe complex machine learning problems to a non-technical audience.
When you describe your solution don’t take the credit unless it really was all your effort. Playing up the contributions of your team will show you’re a good team player. If applicable, point out the customer, schedule and budget impacts this issue has. Show how your contributions you add value to the bottom line, not just the immediate problem.
Don’t forget that the interview will most likely include behavioral questions. And for many engineers and data scientists this is the hardest part! We spend so much time preparing for the technical questions we forget that also going to be evaluated by how we fit into the team.
The more important behavioral questions are below so you can prepare ahead of time. For the questions that ask you to describe a specific time, use the STAR model to outline your answers. Read more on the STAR response here if you don’t know what it is.
11. Tell me about a time you had a conflict at work.
This is a common question for any position. It gives the interviewer a chance to see what it’s like to work with you.
Have a situation in mind before this question comes up. Quickly describe the issue and spend more time explaining how you handled it and what you learned. Show that you can move past conflicts with maturity.
10. Give an example of when you made a mistake at work.
Obviously don’t make it a huge mistake but find an honest one that you learned from. In your recounting of it, own up to the mistake and focus on how you fixed it. Comment on your appreciation for testing or validating that caught the mistake (if it was s technical one).
11. Describe a time when you disagreed with a client. How did you handle it?
Interfacing with clients will probably be some part of your job so use this question to show that you can separate your entirely technical side from a more personable side.
Add Your Questions
What other questions have you been asked in machine learning or data science interviews? Or do you have other questions you like to ask candidates?
Share with the community in the comments below.
© 2019 Katy Medium