Educative Machine Learning System Design - ML Primer Flashcards
What should you expect in a machine learning interview?
Most major companies expect Machine Learning engineers to have solid engineering foundations and hands-on Machine Learning experiences. The candidates go through a similar method of problem solving (Leetcode style), system design, knowledge of machine learning and machine learning system design.
What’s the standard development cycle of machine learning?
It includes data collection, problem formulation, model creation, implementation of models, and enhancement of models.
What are the 6 basic steps to approach Machine Learning System Design?
What do you do during the “problem statement” step to approach Machine Learning System Design?
Asking questions is crucial to filling in any gaps and agreeing on goals.
It’s important to state the correct problems. It is the candidates job to understand the intention of the design and why it is being optimized. It’s important to make the right assumptions and discuss them explicitly with interviewers.
If we are clear on the problem statement of designing a Feed Ranking system, we can then start talking about relevant metrics like user agreements.
What do you do during the “identify metrics” step to approach Machine Learning System Design?
During the development phase, we need to quickly test model performance using offline metrics. You can start with the popular metrics like logloss and AUC for binary classification, or RMSE and MAPE for forecast.
What do you do during the “identify requirements” step to approach Machine Learning System Design? Which two requirements do you need to identify?
- Training requirements
- Inference requirements
Training Requirements
There are many components required to train a model from end to end. These components include the data collection, feature engineering, feature selection, and loss function. For example, if we want to design a YouTube video recommendations model, it’s natural that the user doesn’t watch a lot of recommended videos. Because of this, we have a lot of negative examples. The question is asked:
How do we train models to handle an imbalance class?
Once we deploy models in production, we will have feedback in real time.
How do we monitor and make sure models don’t go stale?
Inference requirements
Once models are deployed, we want to run inference with low latency (<100ms) and scale our system to serve millions of users.
How do we design inference components to provide high availability and low latency?
What do you do during the “identify requirements” step to approach Machine Learning System Design? Which two requirements do you need to identify?
- Training requirements
- Inference requirements
Training Requirements
There are many components required to train a model from end to end. These components include the data collection, feature engineering, feature selection, and loss function. For example, if we want to design a YouTube video recommendations model, it’s natural that the user doesn’t watch a lot of recommended videos. Because of this, we have a lot of negative examples. The question is asked:
How do we train models to handle an imbalance class?
Once we deploy models in production, we will have feedback in real time.
How do we monitor and make sure models don’t go stale?
Inference requirements
Once models are deployed, we want to run inference with low latency (<100ms) and scale our system to serve millions of users.
How do we design inference components to provide high availability and low latency?
What do you do during the “train and evaluate model” step to approach Machine Learning System Design?
3 components:
- feature engineering
- feature selection
- models
For example, in Rental Search Ranking, we will discuss if we should use ListingID as embedding features. In Estimate Food Delivery Time, we will discuss how to handle the latitude and longitude features efficiently.
What do you do during the “train and evaluate model” step to approach Machine Learning System Design?
3 components:
- feature engineering
- feature selection
- models
For example, in Rental Search Ranking, we will discuss if we should use ListingID as embedding features. In Estimate Food Delivery Time, we will discuss how to handle the latitude and longitude features efficiently.
What do you do during the “design high level system” step to approach Machine Learning System Design?
Goal: identify a minimal, viable design to demonstrate a working system.
In this stage, we need to think about the system components and how data flows through each of them. We need to explain why we decided to have these components and what their roles are.
- For example, when designing Video Recommendation systems, we would need two separate components: the Video Candidate Generation Service and the Ranking Model Service.
What do you do during the “scale the design” step to approach Machine Learning System Design?
In this stage, it’s crucial to understand system bottlenecks and how to address these bottlenecks.
You can start by identifying:
- Which components are likely to be overloaded?
- How can we scale the overloaded components?
- Is the system good enough to serve millions of users?
- How we would handle some components becoming unavailable, etc.
Where in the 6 step process to approach machine learning system design is the “problem statement” step located?
The “problem statement” step is the 1st step of the process.
It is to be done before the “identify metrics” step.
Where in the 6-step process to approach machine learning system design is the “identify metrics” step located?
It is the 2nd step of the 6 step process of the approach to machine learning system design.
It is to be done after the “problem statement” step and before the “identify requirements”.
Where in the 6-step process to approach machine learning system design is the “identify requirements” step located?
It is the 3rd step of the 6-step process to approach machine learning system design interview.
It is to be done after the “identify metrics” step and before the “train and evaluate models” step.
Where in the 6-step process to approach machine learning system design is the “train and evaluate models” step located?
It is the 4th step of the process.
It is to be done after the “identify requirements” step and before the “design high level requirements” step.
Where in the 6-step process to approach machine learning system design is the “design high level system” step located?
It is the 5th step in the process.
It is to be done after the “train and evaluate models” step and before the “scale the design” step.