Databricks Certified Machine Learning Professional Exam-style mock test
Databricks Machine Learning Professional Practice Exams|Practice test
Full explanations
Exam format
Pass line 70%
33 USD One-time · lifetime access
Enroll →
Sample questions
Example1 · Experimentation: Data, Feature Store, and MLflow Tracking
A data scientist at a B2B SaaS company is building churn features for accounts. They have a Spark DataFrame account_features keyed by account_id and want to register it so other teams can reuse it. Which FeatureEngineeringClient call correctly creates the managed feature table for the first time?
✓fe.create_table(name='saas.ml.account_churn', primary_keys='account_id', df=account_features)
Correct. create_table defines a new feature table with its primary key schema and populates it from the provided DataFrame in one call.
・fe.register_table(path='saas.ml.account_churn', keys=['account_id'], dataframe=account_features, overwrite=True)
Incorrect. There is no register_table method with a path argument; feature tables are created via create_table using a name and primary_keys.
・fe.write_table(name='saas.ml.account_churn', df=account_features, mode='append')
Incorrect. write_table writes data to an existing feature table and cannot define the primary key schema for a brand-new table.
・fe.publish_table(name='saas.ml.account_churn', source=account_features)
Incorrect. There is no publish_table method; publishing to an online store is done through publish_table in the online-store API, not for initial creation here.
Explanation
Initial creation of a managed feature table uses create_table with name, primary_keys, and the source df; write_table is only for subsequent writes to an existing table.
Example2 · Model Lifecycle: Registry, Deployment, and Serving
A B2B SaaS company trains a churn model in a notebook and logs it to an MLflow run with artifact path 'model'. The MLOps engineer wants to register this logged model as a new version under the registered model 'saas_churn' using the run's URI. Which call accomplishes this?
✓mlflow.register_model(model_uri=f'runs:/{run_id}/model', name='saas_churn')
Correct. mlflow.register_model takes the run-relative model_uri 'runs:/<run_id>/model' and the registered model name, creating a new version under that name.
・mlflow.sklearn.log_model(sk_model=model, name='saas_churn', registered=True)
Incorrect. log_model has no 'registered' boolean; registration from log time uses the 'registered_model_name' parameter, not this signature.
・client.create_registered_model(name='saas_churn', run_id=run_id, path='model')
Incorrect. create_registered_model only creates the empty named container and does not accept a run_id or artifact path to attach a version.
・mlflow.models.register(run_id, 'model', 'saas_churn')
Incorrect. There is no mlflow.models.register function with this positional signature in the MLflow API.
Explanation
mlflow.register_model(model_uri, name) is the canonical way to register an already-logged run artifact as a new version in the Model Registry.
Example3 · Model Monitoring, Drift Detection, and Retraining
A B2B SaaS company serves a churn model whose scoring inputs land in a Delta table. The ML team wants Databricks Lakehouse Monitoring to compare each day's incoming feature distributions against the prior day's window so they can catch gradual feature drift. Which monitor profile type should they configure on the inference table?
・A Snapshot profile, which recomputes aggregate statistics over the entire table on every refresh regardless of timestamp
Incorrect. A Snapshot profile aggregates the whole table each run and does not slice into time windows, so it cannot compare consecutive daily windows for drift.
✓A TimeSeries profile with a timestamp column and granularities so consecutive windows can be compared
Correct. A TimeSeries profile uses a timestamp column plus granularities to produce per-window statistics and a drift metrics table comparing consecutive windows.
・An InferenceLog profile without a timestamp column, relying on the model_id to bucket rows
Incorrect. InferenceLog profiles require a timestamp column and are oriented to model quality; omitting the timestamp breaks the windowing needed here.
・A custom metrics profile only, bypassing the built-in drift tables that the service generates
Incorrect. Custom metrics augment a profile but cannot replace the base profile type that generates the built-in drift comparison tables.
Explanation
TimeSeries (and InferenceLog) profiles slice data by a timestamp column and granularity to emit drift tables comparing consecutive windows; Snapshot profiles aggregate the entire table with no windowing.
Example4 · Scaling ML: Spark ML, Pandas API, and AutoML
A data scientist at a healthcare services firm needs to train hundreds of small per-clinic scikit-learn readmission models in parallel across a Databricks cluster, where each model fits comfortably on a single node. Which approach distributes this workload most appropriately?
・Rewrite each scikit-learn model as a Spark ML Pipeline so the gradient computation itself is parallelized across every executor in the cluster for each clinic
Incorrect. Converting to Spark ML parallelizes a single model's training across nodes, which is wasteful and unnecessary for many small models that each fit on one node; it does not match the embarrassingly parallel per-clinic pattern.
✓Use a pandas UDF or applyInPandas on a Spark DataFrame grouped by clinic, so each group trains independently on an executor
Correct. Grouping by clinic and using applyInPandas (or a grouped pandas UDF) sends each clinic's partition to an executor where the single-node scikit-learn model trains independently, giving true parallelism across groups.
・Collect all clinic data to the driver with toPandas() and loop over clinics sequentially
Incorrect. Collecting to the driver forces sequential, single-machine training and defeats cluster parallelism entirely.
・Set spark.conf to enable AQE and the models will automatically parallelize
Incorrect. Adaptive Query Execution optimizes Spark SQL shuffles and joins; it does not parallelize arbitrary scikit-learn training.
Explanation
Many small independent models are an embarrassingly parallel problem best solved with grouped pandas UDFs / applyInPandas, not by distributing each individual model or collecting to the driver.
Example5 · CI/CD, Webhooks, Jobs, and Production Best Practices
A healthcare services firm retrains its patient-readmission model nightly. The pipeline must run feature engineering, then model training, and finally evaluation, where each notebook depends on the previous one completing successfully. An MLE needs to orchestrate this on Databricks. Which approach best implements this dependency chain?
・Schedule three separate single-task Jobs with staggered cron times and hope each finishes before the next one starts running
Incorrect. Staggered cron times do not guarantee ordering; a slow feature-engineering run could overlap training, producing stale or partial data.
✓Create one multi-task Job with three tasks and set the depends_on field so each task runs only after its predecessor succeeds
Correct. A multi-task Job with depends_on expresses explicit task dependencies, so training starts only after feature engineering succeeds and the orchestration is visible in the Jobs UI.
・Put all three notebooks into a single notebook using %run and schedule it with one task that calls them sequentially in order
Incorrect. %run inlines notebooks into one execution context, losing per-task isolation, retries, and the dependency graph that multi-task Jobs provide.
・Use dbutils.notebook.run inside a driver notebook to call each notebook, catching exceptions manually to decide whether the pipeline should continue
Incorrect. Manual dbutils.notebook.run with exception handling reimplements orchestration the Jobs scheduler already provides natively and is harder to monitor and retry.
Explanation
Databricks multi-task Jobs let you define a DAG of tasks with depends_on, giving explicit ordering, per-task retries, and observability without hand-rolled orchestration.
Example6 · Experimentation: Data, Feature Store, and MLflow Tracking
A data scientist at a healthcare services firm is training a readmission-risk model inside a notebook. She wants every run from this notebook to be logged under a dedicated experiment named '/Shared/readmission_risk' rather than the default notebook experiment. Which single call should she make before starting her MLflow runs?
・mlflow.create_experiment('/Shared/readmission_risk') and rely on it being selected automatically for all subsequent runs in the session
Incorrect. create_experiment only creates (and errors if it already exists); it returns an ID but does not set it as the active experiment for later runs.
✓mlflow.set_experiment('/Shared/readmission_risk')
Correct. set_experiment activates the named experiment (creating it if needed), so all subsequent start_run calls log there.
・mlflow.start_run(experiment_name='/Shared/readmission_risk') so the experiment is both created and activated when the first run begins
Incorrect. start_run does not accept an experiment_name argument; it takes experiment_id, and it will not create an experiment by name.
・mlflow.set_tracking_uri('/Shared/readmission_risk') to point the tracking client at the named experiment path
Incorrect. set_tracking_uri configures where tracking data is stored (the backend), not which experiment is active.
Explanation
mlflow.set_experiment is the idiomatic way to route all runs in a session to a specific named experiment, creating it if it does not yet exist.
Example7 · Experimentation: Data, Feature Store, and MLflow Tracking
A data scientist at the retail brand UrbanThread is building a customer-churn model. They have engineered a Spark DataFrame of per-customer features keyed by customer_id and want to register it as a reusable Feature Store table. Which FeatureStoreClient call correctly creates the table?
✓fs.create_table(name='urbanthread.churn_features', primary_keys='customer_id', df=features_df, description='Churn features')
Correct. create_table defines a Feature Store table with a name, primary_keys, and the source df, registering its schema and lineage in one call.
・fs.register_table(path='urbanthread.churn_features', keys='customer_id', data=features_df)
Incorrect. There is no register_table method on FeatureStoreClient; table creation uses create_table.
・fs.write_table(name='urbanthread.churn_features', df=features_df, mode='merge', keys='customer_id')
Incorrect. write_table writes data to an existing table and does not create the schema; create_table must run first.
・fs.save_features(table='urbanthread.churn_features', dataframe=features_df, key_column='customer_id', mode='overwrite')
Incorrect. save_features is not a valid FeatureStoreClient method and the keyword names are invented.
Explanation
FeatureStoreClient.create_table registers a new feature table with its primary keys and optional source DataFrame; write_table only appends or merges into an already-created table.
Example8 · Experimentation: Data, Feature Store, and MLflow Tracking
UrbanThread's forecasting team needs to join label events to feature values as they existed at each event's timestamp to avoid leakage. They pass FeatureLookup objects into create_training_set. Which additional element makes the join point-in-time correct?
・Setting the FeatureStoreClient to read-only mode before calling create_training_set so historical rows are frozen
Incorrect. There is no read-only mode that enforces point-in-time correctness; the lookup key does that work.
✓Specifying a timestamp_lookup_key on the FeatureLookup that references the event time column in the labels DataFrame
Correct. timestamp_lookup_key tells the Feature Store which event-time column to use so each row joins the feature value valid at that moment.
・Supplying the label column name to exclude_columns
Incorrect. exclude_columns only drops columns from the training set and has nothing to do with temporal joins.
・Adding a timestamp filter in the labels DataFrame
Incorrect. A manual timestamp filter restricts rows but does not align each label to its historically valid feature value.
Explanation
Point-in-time correctness in the Feature Store is achieved by declaring a timestamp_lookup_key on the FeatureLookup, which performs an as-of join against time-series feature tables.
Example9 · Experimentation: Data, Feature Store, and MLflow Tracking
During an MLflow experiment for UrbanThread's recommendation model, a scientist wants a single training function to record the learning rate, the final AUC, and a saved confusion-matrix PNG. Which combination of calls inside a `with mlflow.start_run():` block does this?
✓mlflow.log_param('lr', lr); mlflow.log_metric('auc', auc); mlflow.log_artifact('cm.png')
Correct. log_param stores a hyperparameter, log_metric stores a numeric result, and log_artifact uploads a file to the run.
・mlflow.set_param('lr', lr); mlflow.set_metric('auc', auc); mlflow.save_artifact('cm.png')
Incorrect. set_param, set_metric, and save_artifact are not MLflow logging functions.
・mlflow.record('lr', lr); mlflow.record('auc', auc); mlflow.record('cm.png')
Incorrect. mlflow.record does not exist; there is no single generic logging call for all three types.
・mlflow.log_param('lr', lr); mlflow.log_param('auc', auc); mlflow.log_param('cm.png')
Incorrect. Logging AUC and a PNG as params is wrong; metrics need log_metric and files need log_artifact.
Explanation
MLflow separates logging by type: log_param for inputs, log_metric for numeric outcomes, and log_artifact for files such as plots or models.
Example10 · Experimentation: Data, Feature Store, and MLflow Tracking
A data scientist at a retail bank has engineered a Spark DataFrame named credit_features keyed by customer_id and wants to register it as a reusable Feature Store table so other fraud teams can look up the same features. Which FeatureStoreClient call correctly creates the table and writes the initial data in one step?
✓fs.create_table(name='fraud.credit_features', primary_keys='customer_id', df=credit_features, description='credit features')
Correct. create_table accepts name, primary_keys, df, and description, creating the table schema and writing the supplied DataFrame in a single call.
・fs.write_table(name='fraud.credit_features', df=credit_features, mode='overwrite', keys='customer_id')
Incorrect. write_table only appends or overwrites data into an already-existing feature table; it cannot create the table or set primary keys.
・fs.register_dataframe(credit_features, table='fraud.credit_features', key='customer_id')
Incorrect. register_dataframe is not a FeatureStoreClient method, so this call fails.
・fs.publish_table(df=credit_features, online_store='fraud.credit_features', lookup_key='customer_id')
Incorrect. publish_table pushes an existing offline table to an online store and does not create a new offline feature table from a DataFrame.
Explanation
create_table is the one-step API that defines primary keys and writes the initial feature data; write_table and publish_table operate on tables that already exist.
Example11 · Experimentation: Data, Feature Store, and MLflow Tracking
A fraud modeling team at an investment firm has a labels DataFrame containing customer_id and a fraud_flag target. They want to join precomputed features from the Feature Store table fraud.credit_features automatically at training time. Which approach is the intended Feature Store pattern?
・Manually join the labels DataFrame to the feature table with a Spark join on customer_id before fitting the model
Incorrect. A manual Spark join bypasses the Feature Store, so no lineage is recorded and the join logic is not packaged with the model for inference.
✓Define a FeatureLookup for the feature table and pass it to fs.create_training_set with the labels DataFrame
Correct. FeatureLookup specifies which features and join keys to pull, and create_training_set assembles the labeled training DataFrame while recording lineage.
・Call fs.read_table on the feature table and concatenate columns to labels with pandas
Incorrect. read_table returns raw features but loses the automatic lookup packaging needed for consistent scoring later.
・Load the feature table into a Delta view and query it with spark.sql during each epoch
Incorrect. Querying a Delta view per epoch does not use the Feature Store lookup mechanism and records no feature lineage.
Explanation
The Feature Store pattern uses FeatureLookup objects with create_training_set so the same lookups are reproduced automatically during batch or online inference.
Example12 · Experimentation: Data, Feature Store, and MLflow Tracking
A data scientist at a manufacturing distributor has built a Spark DataFrame of per-SKU demand features keyed by 'sku_id'. They want to register it as a Feature Store table so other teams can reuse it. Which approach correctly creates the feature table?
✓Call fe.create_table() with name, primary_keys of 'sku_id', df, and a schema to register and populate it at once
Correct. FeatureEngineeringClient.create_table() with name, primary_keys, df, and schema both registers the metadata and writes the provided DataFrame in one call.
・Save the DataFrame with df.write.saveAsTable(), then manually insert a descriptive row into the hive_metastore catalog so the primary key is declared
Incorrect. A plain saveAsTable plus manual metastore editing does not register the table in Feature Store or declare its primary key through the supported API.
・Call fe.write_table() first to create the backing storage, then register the primary key afterward by editing Delta properties
Incorrect. write_table() appends or overwrites data in an already-created feature table; it does not create the table or define the primary key.
・Use fe.log_table() with the model run so the features are versioned alongside the experiment artifacts
Incorrect. There is no log_table() feature-registration call; feature tables are created with create_table(), not attached to a run.
Explanation
create_table() is the single API that registers a feature table's schema and primary keys while optionally populating it from a DataFrame.
Example13 · Experimentation: Data, Feature Store, and MLflow Tracking
An analyst is building a training set that joins order records to a feature table of warehouse inventory levels that changes hourly. Each order has an 'order_ts' timestamp. To prevent using inventory values recorded after the order occurred, which configuration should the FeatureLookup use?
✓Specify a timestamp_lookup_key referencing 'order_ts' so each row joins the feature value valid at or before that time
Correct. A timestamp_lookup_key tells Feature Store to perform a point-in-time join, returning only the feature value valid at or before each order's timestamp.
・Set the lookup_key to 'order_ts' and let Feature Store broadcast the entire inventory history into every single training row
Incorrect. Broadcasting the full history into every row does not restrict to values at or before the event time and defeats point-in-time correctness.
・Disable the primary-key join and let the training set reuse one latest inventory snapshot for all order rows
Incorrect. Using the latest snapshot for all rows introduces exactly the label leakage the analyst is trying to avoid.
・Add a plain WHERE filter on order_ts after the unrestricted join has already completed
Incorrect. Filtering after an unrestricted join cannot recover which feature value was valid at each order's moment.
Explanation
Point-in-time correctness is achieved by declaring a timestamp_lookup_key so each row receives the feature value as of its event time.
Example14 · Experimentation: Data, Feature Store, and MLflow Tracking
A telecom operator stores its daily churn-labeling table as a managed Delta table named churn.labels. A data scientist trained a model last Tuesday and now needs to reproduce that run against the exact snapshot of churn.labels as it existed on that date. Which approach lets them read the historical snapshot?
✓Query the table with the versionAsOf or timestampAsOf read option against the Delta table's transaction history
Correct. Delta Lake time travel exposes prior snapshots through versionAsOf (version number) or timestampAsOf (timestamp), so the scientist can read Tuesday's data without mutating the current table.
・Restore the production table to Tuesday with RESTORE so the current data matches the old snapshot
Incorrect. RESTORE would overwrite the live production table to an old state, breaking current workloads instead of just reading a historical snapshot.
・Re-run the upstream ingestion job pointed at Tuesday's raw files to rebuild the data
Incorrect. Re-running ingestion rebuilds data from raw files and is error-prone; time travel already retains the exact snapshot in the transaction log.
・Read the _delta_log JSON files directly and manually reconstruct the Parquet files that were current on Tuesday
Incorrect. Manually parsing _delta_log and stitching Parquet files is unnecessary and fragile when the versionAsOf/timestampAsOf option does it natively.
Explanation
Delta Lake's transaction log enables time travel via versionAsOf or timestampAsOf, the canonical way to reproduce training against a past snapshot.
Example15 · Experimentation: Data, Feature Store, and MLflow Tracking
A telecom data scientist is training a churn model inside an MLflow run and wants the learning-rate hyperparameter and the final validation AUC to appear in the Experiments UI so runs can be sorted and compared. Which pair of MLflow calls records these correctly?
✓mlflow.log_param for the learning rate and mlflow.log_metric for the validation AUC
Correct. Hyperparameters are logged with log_param and numeric evaluation results with log_metric, which makes both sortable and comparable in the Experiments UI.
・mlflow.set_tag for both the learning rate and the validation AUC value
Incorrect. set_tag stores metadata as tags, not as parameters or metrics, so neither value would be treated as a comparable param or metric.
・mlflow.log_artifact for the learning rate and mlflow.log_metric for the validation AUC
Incorrect. log_artifact stores files, not scalar hyperparameters, so the learning rate would not appear as a searchable parameter.
・mlflow.log_param for both the learning rate and the validation AUC so they stay together
Incorrect. AUC is a metric, not a parameter; logging it via log_param loses the time-series and numeric comparison behavior of metrics.
Explanation
MLflow separates params (inputs) from metrics (outputs): log_param for hyperparameters and log_metric for evaluation scores.
▶ Try 10 free questions (graded)