Educative Grokking the ML Interview Flashcards
How a candidate should approach machine learning system design questions?
- Setting up the problem
- Understanding the scale and latency requirements
- Defining metrics
- Architecture discussions
- Offline model building & execution
- Online model execution & evaluation
- Iterative model improvement
How do you close the gap between your understanding of the question and the interviewer’s expectations from your answer?
Ask questions
You will be able to narrow down your problem space, chalk out the requirements of the system, and finally arrive at a precise machine learning problem statement.
What should you do after arriving at a precise machine learning problem statement?
Discuss about performance and capacity considerations of the system
Latency requirements and scale of the data
Why is defining metrics important?
Metrics will help you to see if your system is performing well.
What are some metrics used for offline testing?
You may have generic metrics; for example, if you are performing binary classification, you will use AUC, log loss, precision, recall, and F1-score. In other cases, you might have to come up with specific metrics for a certain problem. For instance, for the search ranking problem, you would use NDCG as a metric.
When is offline metrics used?
You will use offline metrics to quickly test the models’ performance during the development phase.
When is online metrics used?
Once you have selected the best performing models offline, you will use online metrics to test them in the production environment. The decision to deploy the newly created model depends on its performance in an online test.
Which type of metrics do you may need to come up with online metrics?
While coming up with online metrics, you may need both component-wise and end-to-end metrics.
Consider that you are making a search ranking model to display relevant results for search queries. You may use a component-wise metric such as NDCG to measure the performance of your model online. However, you also need to look at how the system (search engine) is performing with your new model plugged in, for which you can use end-to-end metrics. A commonly used end-to-end metric for this scenario is the users’ engagement and retention rate.
When should the architecture discussion come up?
The architecture discussion comes up after defining metrics, which comes after setting up the problem and understanding requirements.
What do you need to think about when figuring out the architecture of the system?
You need to think about the components of the system and how the data will flow through those components.
Which phase/step in the ML system setup helps in chalking out the architecture?
The requirements gathered during problem setup help you in chalking out the architecture.
What are the different ways one can generate training data?
- Human labeled data
- Data collection through a user’s interaction with the pre-existing system
What should our goal be when working on machine learning-based system?
As we work on a machine learning-based system, our goal is generally to improve our metrics (engagement rate, etc.) while ensuring that we meet the capacity and performance requirements.
When does major performance and capacity discussions come up again after defining the requirements?
Major performance and capacity discussions come in during the following two phases of building a machine learning system:
- Training time: How much training data and capacity is needed to build our predictor?
- Evaluation time: What are the Service level agreement (SLA) that we have to meet while serving the model and capacity needs?
What are the three different types of complexities that ML algorithms have?
- Training complexity
- Evaluation complexity
- Sample complexity