Coding Interview types: ML/Data Science/AI Research Engineer
I recently interviewed with Microsoft (Data Scientist ll), Amazon (Applied AI Scientist) and Apple (Software Development : Machine Learning). I wrote about the preparation involved on the Machine Learning side and received a lot of questions about coding questions in interviews.
These are the major types of questions I was asked. Obviously the difficulty will varying according to the team and the company. Feel free to add more questions!
Take home assignments
These are my favorite types of tests because you can actually showcase your skills. Here are some of the types of questions I have been asked
- A dataset will be given and you will need to build Machine Learning models to show how much your model perform on the test data in 24 hours as compared to others. The task usually relates to the your everyday job in the company.
- Basics of probability and statistics questions- I got one question which involved finding some bounds on a custom algorithm and then proving it theoretically. There can be questions for hypothesis testing and interpreting the results.
Some pointers you can keep in mind for acing such interviews -
- Put in good documentation for your code
- Show your Object Oriented programming skills even if you are coding in jupyter notebook and python. Eg. You can have a different visualization module.
- Have a through Data Analysis part- This shows that you have tried to understand the problem statement. It’s a plus if you include some hypothesis tests in your analysis.
Standard Data Structure and Algorithms questions
These are leetcode type questions. Usually these are not very tough if your team is a bit research oriented or more Machine Learning focused. In fact going through some algorithm and data structure basics should be enough. Be sure you can code a basic problem in 20–30 minutes.
Different companies have different types of live coding sessions and sometimes there can be multiple people evaluating you at the same time. These can also be of three types
- DS / Algo questions- One thing to practice in this part is that you are able to code the basic structure in a few minutes so that you can concentrate on the problem solving more. Eg. Given a graph question be sure to code the main graph class quickly along with some traversal if required.
- Deep Learning coding- I have been asked to code simple image classification, sequence to sequence model. The interviewer is not checking your syntax but the flow. Example you should know how to form a custom dataloader, why you zero the gradients before backpropagating and the type of loss you will use… and so on.
- Machine learning algorithms coding- I was asked to code random forest followed by bagging and boosting (not kidding here!). I realized the interviewer was only trying to check if I understand the differences and have a direction of how will it be implemented.