WGU D501 MACHINE LEARNING DEVOPS
PROJECT 2: DEPLOY A SCALABLE ML
PIPELINE WITH FASTAPI | CENSUS
CLASSIFIER, API TESTING, SLICE
METRICS & MODEL CARD | 2026/2027
UPDATED | ORIGINAL PRACTICE
QUESTION BANK
INTRODUCTION
This original practice question bank is designed to help learners prepare for project
work involving machine-learning development and deployment workflows. The
questions emphasize practical reasoning rather than simple memorization. Scenarios
cover the complete lifecycle of a production-oriented classification service: data
preparation, model training, serialization, reproducibility, FastAPI application design,
request validation, prediction endpoints, automated testing, containerization,
scalability, monitoring, performance evaluation, subgroup or slice analysis, and
model-card documentation.
The Census classification context is used to explore realistic production decisions
such as preprocessing consistency, categorical encoding, missing-value handling,
probability outputs, threshold selection, and prevention of training-serving skew.
Several questions require interpretation of confusion matrices and slice metrics rather
than relying only on aggregate accuracy. Others address engineering concerns
including health checks, deterministic inference, dependency management, API
contracts, error handling, logging, and deployment architecture.
The goal is to develop the ability to connect machine-learning performance with
software-engineering reliability and responsible deployment. Each question has
one best answer followed by a detailed rationale explaining both the correct choice
and the weaknesses of the alternatives.
CORE DOMAINS TESTED
1.
Census Classification and ML Problem Definition
2.
3.
1
,Data Cleaning and Preprocessing
4.
5.
Feature Engineering and Encoding
6.
7.
Train/Test Separation and Data Leakage
8.
9.
Classification Models and Decision Thresholds
10.
11.
Model Serialization and Reproducibility
12.
13.
FastAPI Application Architecture
14.
15.
Request Validation and Response Schemas
16.
17.
API Testing
18.
19.
Containerization and Deployment
20.
21.
Scalability and Reliability
22.
23.
2
, Model Performance Metrics
24.
25.
Confusion-Matrix Analysis
26.
27.
Slice Metrics and Subgroup Evaluation
28.
29.
Monitoring and Observability
30.
31.
Model Cards and Documentation
32.
33.
Responsible ML and Fairness
34.
35.
Production Troubleshooting
36.
37.
CI/CD and MLOps Practices
38.
39.
End-to-End ML Pipeline Design
40.
QUESTIONS 1–100
3
, Q1:
A Census classification model is trained to predict whether an individual's income
exceeds a specified threshold. During deployment, the API receives the same raw
fields used during training, but the preprocessing code is implemented separately
inside the FastAPI application. Which design most directly reduces the risk of
training-serving skew?
A) Increase the number of trees in the classifier
B) Persist and reuse the same preprocessing pipeline used during training
C) Remove all categorical variables before deployment
D) Retrain the model every time an API request arrives
Rationale: B is correct because using the same persisted preprocessing
transformation ensures that inference data undergoes the same encoding,
imputation, scaling, and feature-order logic used during training. A does not
address preprocessing inconsistency. C unnecessarily discards potentially useful
information. D is computationally inappropriate and does not solve training-
serving skew.
Q2:
A developer calculates a categorical encoder using the entire Census dataset before
splitting the observations into training and testing sets. Why can this be problematic?
A) It necessarily makes the model underfit
B) It prevents categorical variables from being represented numerically
C) Information from the test set can influence the preprocessing fitted on the
training data
D) It guarantees that test accuracy will be lower than training accuracy
Rationale: C is correct because preprocessing parameters or category
information derived from the complete dataset can allow information from the
eventual test set to influence the training process. This is a form of leakage. A is
not necessarily true. B is false because encoders are specifically designed to
represent categorical variables numerically. D is not guaranteed.
Q3:
A deployed classifier suddenly produces a large number of validation errors because
incoming JSON requests sometimes omit an optional Census field. Which FastAPI
feature is most appropriate for defining expected request structure and validation
behavior?
A) Random Forest
B) Docker
C) Pydantic-based request models
D) ROC-AUC
4
PROJECT 2: DEPLOY A SCALABLE ML
PIPELINE WITH FASTAPI | CENSUS
CLASSIFIER, API TESTING, SLICE
METRICS & MODEL CARD | 2026/2027
UPDATED | ORIGINAL PRACTICE
QUESTION BANK
INTRODUCTION
This original practice question bank is designed to help learners prepare for project
work involving machine-learning development and deployment workflows. The
questions emphasize practical reasoning rather than simple memorization. Scenarios
cover the complete lifecycle of a production-oriented classification service: data
preparation, model training, serialization, reproducibility, FastAPI application design,
request validation, prediction endpoints, automated testing, containerization,
scalability, monitoring, performance evaluation, subgroup or slice analysis, and
model-card documentation.
The Census classification context is used to explore realistic production decisions
such as preprocessing consistency, categorical encoding, missing-value handling,
probability outputs, threshold selection, and prevention of training-serving skew.
Several questions require interpretation of confusion matrices and slice metrics rather
than relying only on aggregate accuracy. Others address engineering concerns
including health checks, deterministic inference, dependency management, API
contracts, error handling, logging, and deployment architecture.
The goal is to develop the ability to connect machine-learning performance with
software-engineering reliability and responsible deployment. Each question has
one best answer followed by a detailed rationale explaining both the correct choice
and the weaknesses of the alternatives.
CORE DOMAINS TESTED
1.
Census Classification and ML Problem Definition
2.
3.
1
,Data Cleaning and Preprocessing
4.
5.
Feature Engineering and Encoding
6.
7.
Train/Test Separation and Data Leakage
8.
9.
Classification Models and Decision Thresholds
10.
11.
Model Serialization and Reproducibility
12.
13.
FastAPI Application Architecture
14.
15.
Request Validation and Response Schemas
16.
17.
API Testing
18.
19.
Containerization and Deployment
20.
21.
Scalability and Reliability
22.
23.
2
, Model Performance Metrics
24.
25.
Confusion-Matrix Analysis
26.
27.
Slice Metrics and Subgroup Evaluation
28.
29.
Monitoring and Observability
30.
31.
Model Cards and Documentation
32.
33.
Responsible ML and Fairness
34.
35.
Production Troubleshooting
36.
37.
CI/CD and MLOps Practices
38.
39.
End-to-End ML Pipeline Design
40.
QUESTIONS 1–100
3
, Q1:
A Census classification model is trained to predict whether an individual's income
exceeds a specified threshold. During deployment, the API receives the same raw
fields used during training, but the preprocessing code is implemented separately
inside the FastAPI application. Which design most directly reduces the risk of
training-serving skew?
A) Increase the number of trees in the classifier
B) Persist and reuse the same preprocessing pipeline used during training
C) Remove all categorical variables before deployment
D) Retrain the model every time an API request arrives
Rationale: B is correct because using the same persisted preprocessing
transformation ensures that inference data undergoes the same encoding,
imputation, scaling, and feature-order logic used during training. A does not
address preprocessing inconsistency. C unnecessarily discards potentially useful
information. D is computationally inappropriate and does not solve training-
serving skew.
Q2:
A developer calculates a categorical encoder using the entire Census dataset before
splitting the observations into training and testing sets. Why can this be problematic?
A) It necessarily makes the model underfit
B) It prevents categorical variables from being represented numerically
C) Information from the test set can influence the preprocessing fitted on the
training data
D) It guarantees that test accuracy will be lower than training accuracy
Rationale: C is correct because preprocessing parameters or category
information derived from the complete dataset can allow information from the
eventual test set to influence the training process. This is a form of leakage. A is
not necessarily true. B is false because encoders are specifically designed to
represent categorical variables numerically. D is not guaranteed.
Q3:
A deployed classifier suddenly produces a large number of validation errors because
incoming JSON requests sometimes omit an optional Census field. Which FastAPI
feature is most appropriate for defining expected request structure and validation
behavior?
A) Random Forest
B) Docker
C) Pydantic-based request models
D) ROC-AUC
4