Answer Framework
-
Alex XU ML System Design Interview
-
https://www.youtube.com/watch?v=XN2ymraj27g
-
https://www.metacareers.com/blog/how-to-video-applying-machine-learning-to-your-product/
4*. https://github.com/alirezadir/Machine-Learning-Interviews/blob/main/src/MLSD/ml-system-design.md
⚠️ Note: Remember when using this design flow during an interview to be flexible.
According to the needs of the interview or the interests of the interviewer,
you may skip some of these components or spend more time for a deep dive in one or two components
- Problem Understanding
- Business objectives and constraintss
- Scale requirements (QPS, latency, data volume)
- Available resources and limitations
- ML Problem Formulation
- Type of ML task and potential approaches
- Input/Output specification
- Key challenges and tradeoffs
- Data & Feature Strategy
- Data sources and collection strategy
- Feature engineering approach
- Data validation and quality control
- Modeling Strategy
- Model selection criteria
- Training methodology
- Optimization objectives
- Experimentation framework
- Evaluation Framework
- Offline evaluation strategy
- Online experimentation approach
- Key metrics and monitoring
- System Architecture
- Training pipeline
- Inference pipeline
- Monitoring and maintenance
- Please include a high-level system diagram
- Deployment and Monitoring
In short:
- Problem Understanding
- ML Problem Formulation
- Data & Feature Strategy
- Modeling Strategy
- Evaluation Framework
- System Architecture
- Deployment and Monitoring
Detailed Fraemwork of describing system
1. Problem Formulation & Scoping
Understand Use Case(s) and Business Goals of Designing system
- Clarifying Questions
- Requirements
- Scope (features needed), scale, and personalization
- Performance: prediction latency, scale of prediction
- Constraints
- Data: sources and availability
2. Translate an Abstract Problem into an ML Problem
- ML objective
- ML I/O
- ML category (e.g., binary classification, multi-classification, unsupervised learning, etc.)
- Do We Need ML to Solve This Problem?
- Trade-off between impact and cost
- Costs: Data collection, data annotation, compute
- Decision: ML system design or general system design flow
- Note: Assume ML is needed in an ML system design interview
3. Data & Features
- Data Needs
- Target variable
- Big actors in signals (e.g., users, items, etc.)
- Type (e.g., image, text, video, etc.) and volume
- Data Sources
- Availability and cost
- Implicit (logging), explicit (e.g., user survey)
- Data Storage
- ML Data Types
- Structured
- Numerical (discrete, continuous)
- Categorical (ordinal, nominal)
- Unstructured (e.g., image, text, video, audio)
- Labelling (for Supervised Learning)
- Labeling methods
- Natural labels (e.g., clicks, likes, purchase)
- Handling lack of labels
- Programmatic labeling methods
- Semi-supervised methods
- Weak supervision
- Transfer learning
- Active learning
- Labeling cost and trade-offs
- Data Augmentation
- Data Generation Pipeline
4. Modeling
- Model Selection (MVP)
- Dataset
- Model Training
- Model Validation and Offline Evaluation
5. Evaluation
- Offline Metrics
- Online Metrics
- Trade-offs Between Metrics
6. System Architecture
Desing(more often – plot) High-Level Architecture and Main Components
- Non-ML Components
- ML Components