Machine Learning Professional · 44% of the exam

Model Development: free practice questions

5 sample questions from our 24-question bank for this domain — answers and explanations included. These are the same scenario-based style as the real Databricks exam.

1. A Spark ML pipeline must chain a StringIndexer, a VectorAssembler, and a classifier so the same transformations apply consistently at train and inference time. Which construct enforces this?

  • A. A Spark ML Pipeline (stages of Transformers and an Estimator)✓ Correct
  • B. A plain Python list of functions
  • C. A Databricks Job
  • D. A Delta table
Explanation

A Spark ML Pipeline bundles Transformers and an Estimator into stages, so fitting produces a PipelineModel that applies the identical sequence at inference — preventing training/serving skew. A list of functions (B) isn't a managed pipeline, a Job (C) orchestrates tasks, and a Delta table (D) stores data.

2. A data scientist wants to log a custom evaluation metric (e.g., a business-specific weighted error) alongside standard metrics for a run. How should they do this in MLflow?

  • A. Compute the metric and log it with mlflow.log_metric()✓ Correct
  • B. It is impossible to log custom metrics in MLflow
  • C. Rename the model file to include the metric
  • D. Store it only in a local variable
Explanation

Custom metrics are logged with mlflow.log_metric(), appearing alongside autologged metrics in the run. Custom metrics are fully supported (B is false), renaming the file (C) doesn't track it, and a local variable (D) isn't persisted to the run.

3. Which statement about the Databricks Feature Store and training/serving skew is TRUE?

  • A. Using the same feature tables for both training and inference reduces training/serving skew because the feature computation is defined once✓ Correct
  • B. It increases skew by computing features differently at serving time
  • C. It only works for streaming data
  • D. It replaces the need for a model entirely
Explanation

Centralizing feature definitions in feature tables means the same computed features are used for training and inference, reducing training/serving skew. It doesn't increase skew (B), isn't streaming-only (C), and doesn't replace the model (D).

4. Why log the training data version (e.g., a Delta table version or snapshot) with an MLflow run?

  • A. So the exact data used can be reproduced later via Delta time travel, aiding reproducibility and auditing✓ Correct
  • B. To make the model serve faster
  • C. To change the model's hyperparameters
  • D. To split serving traffic
Explanation

Recording the data version lets you reproduce the exact training dataset later using Delta time travel, supporting reproducibility and audits. It doesn't affect serving speed (B), hyperparameters (C), or traffic splitting (D).

5. A model's inputs include categorical columns that must be consistently encoded at train and inference. What is the BEST way to guarantee consistency in a Spark ML workflow?

  • A. Include the encoding stages (e.g., StringIndexer/OneHotEncoder) inside the fitted Pipeline so they are applied identically at inference✓ Correct
  • B. Encode manually in the training notebook and hope inference matches
  • C. Skip encoding and feed raw strings to the model
  • D. Encode differently at inference for variety
Explanation

Putting encoders inside the Pipeline means the PipelineModel applies the exact same fitted encoding at inference, avoiding skew. Manual, unmanaged encoding (B) risks mismatch, feeding raw strings (C) fails for most estimators, and inconsistent encoding (D) breaks predictions.

19 more questions in this domain

Practice the full bank with instant grading, flashcards, and a timed mock exam.

Start practicing free