All Databricks exams
Free Databricks Certified Machine Learning Professional practice test: 30 questions with answers
30 original questions for Databricks Certified Machine Learning Professional, drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.
- Free questions
- 30
- Full bank
- 112 questions
Databricks Certified Machine Learning Professional exam guide: topics, cost and format
All 30 Databricks Certified Machine Learning Professional questions with answers
The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.
Model Development (10 questions)
Question 1
A data scientist logs a model with MLflow autologging, but the team must be able to reproduce the exact preprocessing that was applied before training. What should be logged alongside the model?
- AOnly the final fitted model artifact, since the preprocessing can be rebuilt from the notebook later on
- BThe text output of each notebook cell from the training session as a plain text attachment on the run
- CA screenshot of the training loss curve from the notebook so that the run can be compared visually
- DThe full pipeline as a model with its input signature, together with the code version used for training
Show answer and explanationHide answer
Correct answer: DLogging the full pipeline with its signature and the code version lets the exact preprocessing and input schema be reproduced later. A bare model file, a screenshot, or cell output cannot reconstruct the transformations that produced the training features.
Question 2
Which Hyperopt option distributes the trials of a hyperparameter search across a Spark cluster?
- ATrials, which records the results of each evaluation in memory on the single driver process only
- BSparkTrials, which runs each trial as a Spark task so that the search uses the cluster's workers
- CCalling fmin on its own, which runs every evaluation sequentially on whichever worker is available
- DA plain Python for loop that calls the objective function once per candidate set of parameters
Show answer and explanationHide answer
Correct answer: BSparkTrials dispatches each trial to the cluster so that the search scales with the number of workers. Trials keeps results on the driver, and fmin alone or a Python loop runs evaluations on a single process rather than distributing them.
Question 3
Why should feature transformers and the estimator be combined in a Spark ML Pipeline?
- ASo that every transformer runs twice during training, which improves the accuracy of the fitted model across all of the data partitions in the cluster
- BSo that the same transformations are applied consistently at training and inference time, which avoids leakage
- CSo that the full dataset is copied to the driver node so that transformations run faster on a single machine
- DSo that the model can be deployed without any saved artifacts, because the pipeline stores all its own data
Show answer and explanationHide answer
Correct answer: BA pipeline bundles the fitted transformers with the estimator, so the same fitted steps are reapplied to new data and training statistics are not recomputed on the test set. Running transformers twice, copying data to the driver, and deploying without artifacts all misunderstand what a pipeline provides.
Question 4
A feature is computed using statistics from the full dataset before the train and test split is made. What is the consequence?
- ATraining will be faster because the statistics have already been precomputed before the split is made
- BThe model will fail to train because the feature contains missing values that the algorithm cannot use
- CInformation from the test set leaks into training, which inflates the evaluation metrics of the model
- DThe model will generalize better to unseen data automatically because it has seen the whole distribution
Show answer and explanationHide answer
Correct answer: CComputing statistics on all rows lets test-set information influence the training features, so evaluation looks better than real performance on new data. Missing values, training speed, and generalization are not the consequences of this leak.
Question 5
Which benefit does a feature table in Unity Catalog provide for machine learning teams?
- AA replacement for the model registry, so that registered models no longer need to be tracked
- BAutomatic hyperparameter tuning for every model that a team trains in the workspace each week, with full reports
- CUnlimited storage for raw data at no cost to the organization across all of its workspaces
- DReusable, governed features with point-in-time lookups that build correct training sets for models
Show answer and explanationHide answer
Correct answer: DFeature tables in Unity Catalog share governed features across models and support point-in-time joins for training data. Tuning, free storage, and replacing the model registry are not what feature tables provide.
Question 6
Which two statements about point-in-time feature lookups are correct? (Choose two.)
- AThey join each feature value as it was at the timestamp of the corresponding training label
- BThey use the latest feature values regardless of the label timestamps, which keeps the lookup simple
- CThey prevent information from after the label time from leaking into the training examples built
- DThey require the model to be served from the same cluster on which the training data was prepared
- EThey are needed only for image models, where the timing of each frame matters for the lookup
Show answer and explanationHide answer
Correct answer: A, CPoint-in-time lookups match each label to feature values that existed at its timestamp, which blocks future information from entering the training set. Using the latest values for every label reintroduces leakage, and cluster placement and model type do not determine the lookup behaviour.
Question 7
Which MLflow feature lets a team compare the runs of a hyperparameter search side by side?
- AThe Experiments UI, with a table and parallel coordinates view of the runs and their metrics
- BThe Model Serving page, which shows the endpoints and the traffic that each one has received
- CThe Delta Live Tables event log, which records pipeline updates and data quality expectations
- DThe cluster event log, which records the start, resize, and termination events of compute clusters
Show answer and explanationHide answer
Correct answer: AThe MLflow Experiments UI shows runs with their parameters and metrics in tables and charts, which supports comparison across a search. The serving page, pipeline event log, and cluster log track deployments, pipelines, and compute rather than experiment runs.
Question 8
A team needs to apply a scikit-learn model to each row of a large Spark DataFrame efficiently. Which approach fits best?
- AWriting the serialized model into every row as a string column so that each row carries its own copy
- BA Python loop that collects the DataFrame to the driver node and then scores the rows one at a time
- CA Pandas UDF or mapInPandas over batches, loading the model once per executor and scoring in bulk
- DRunning a separate notebook for each row of the table so that every prediction is computed in isolation
Show answer and explanationHide answer
Correct answer: CPandas UDFs and mapInPandas process batches in parallel on executors and can load the model once per worker, which scales well. Collecting to the driver, copying the model into every row, and running a notebook per row each remove the parallelism or waste resources.
Question 9
Which approach supports distributed training of deep learning models across several GPUs on Databricks?
- ATorchDistributor or Horovod-based distributed training launched across the workers of the cluster
- BA single-node training loop that keeps the whole model on one GPU for the full length of the job
- COpening the MLflow UI in a browser and waiting for the training job to finish on its own schedule
- DRunning the VACUUM command on the Delta tables that hold the training data before each epoch starts
Show answer and explanationHide answer
Correct answer: ATorchDistributor and Horovod launch training across multiple workers and GPUs, which is the distributed approach the question asks for. A single GPU loop does not distribute training, while the MLflow UI and VACUUM do not train models.
Question 10
Why does an MLflow model signature matter when a model is logged?
- AIt sets the license terms under which the model may be used for commercial purposes by customers
- BIt encrypts the model file with the key of the user who logged it, so that only that user can load it
- CIt records the input and output schema so that serving endpoints can validate requests against it
- DIt is required before any metrics can be written to the run, so that the run record can be created
Show answer and explanationHide answer
Correct answer: CA signature documents the expected inputs and outputs, which lets MLflow and serving reject malformed requests early. Encryption, licensing, and metric logging are unrelated to the signature.
MLOps (10 questions)
Question 11
Which kind of test checks that a feature function returns the expected output for known inputs?
- AA load test, which measures how the endpoint behaves when many concurrent requests arrive together from clients across the network
- BA unit test, which checks one function in isolation against inputs whose expected outputs are known
- CA penetration test, which tries to find security weaknesses in the infrastructure from outside it
- DA canary deployment, which routes a small share of live traffic to the new version of the service
Show answer and explanationHide answer
Correct answer: BUnit tests verify individual functions against known inputs and expected outputs, which is what this check requires. Load tests, penetration tests, and canary deployments test performance, security, and rollout, not the correctness of a single function.
Question 12
Which signal most appropriately triggers the retraining of a production model?
- AEvery new row that is added to the source table, so that the model always uses the freshest data available
- BThe calendar date alone, so that retraining happens on the same day every month regardless of change
- CA significant drop in production performance or a sustained shift in the distribution of the inputs
- DA change in the font size used in the notebook that contains the training code for the model in question
Show answer and explanationHide answer
Correct answer: CRetraining should respond to evidence that the model is degrading, such as falling metrics or sustained input drift. Fixed calendars can waste effort or miss changes, retraining on every row is costly and noisy, and notebook formatting has no bearing on model quality.
Question 13
Which statistic is commonly used to compare the distribution of a feature between training data and production data?
- AThe population stability index or a Kolmogorov-Smirnov test that compares the two distributions directly
- BThe arithmetic mean of the notebook run times recorded across the last several weeks of development
- CThe number of columns in the table that holds the training data for the model in its current production version and its earlier versions
- DThe count of cells in the notebook that was used to build the training dataset for the first release
Show answer and explanationHide answer
Correct answer: APopulation stability index and the Kolmogorov-Smirnov test quantify how far a feature's distribution has moved, which is the basis of drift detection. Run times, column counts, and cell counts describe the workflow rather than the data.
Question 14
What does Lakehouse Monitoring provide for a monitored table or an inference log?
- AAutomated model training that starts whenever a new file is written to the monitored storage location
- BA replacement for Delta time travel, so that older versions of the table can be queried in future
- CProfile and drift metrics computed over time and stored in monitoring tables that can be queried
- DA cluster autoscaling policy that adjusts the number of workers according to the table's query load
Show answer and explanationHide answer
Correct answer: CLakehouse Monitoring computes profile and drift metrics on a schedule and writes them to monitoring tables, which is how drift is observed. It does not replace time travel, train models, or manage cluster scaling.
Question 15
Which two practices reduce risk when a model is promoted from staging to production? (Choose two.)
- APromoting a registered model version only after automated tests pass and an approval step is recorded
- BCopying the model file by hand into the production folder without keeping any record of the change
- CUsing a registry alias such as champion to point serving at a version that has already been tested
- DSkipping staging altogether, because production already holds the same data as the staging environment
- EOverwriting the production model in place without keeping the previous version available for rollback
Show answer and explanationHide answer
Correct answer: A, CGated promotion with tests and approval, combined with aliases that point to tested versions, makes releases repeatable and reversible. Manual copies, skipping staging, and overwriting without a rollback path each remove the checks and the record that promotion depends on.
Question 16
Where should environment-specific settings such as catalog and schema names live in a multi-environment ML project?
- AHardcoded inside each notebook, so that every developer can see the exact values used in the code
- BIn the target definitions of the bundle configuration, so the same code deploys to dev, staging, and production
- CIn a personal developer's notebook, which the team copies to each environment when it is deployed
- DIn the Spark configuration of a single cluster, so that every job on that cluster inherits the settings
Show answer and explanationHide answer
Correct answer: BTargets in the bundle configuration keep the code identical across environments while the settings differ per target. Hardcoding values, personal notebooks, and cluster-level configuration each make deployments error-prone and tie the code to one environment.
Question 17
Why should the version of the training data be logged with a model training run?
- ASo that the run can be reproduced exactly and differences between model versions can be explained later
- BSo that the model artifact becomes smaller, because the data version lets MLflow skip redundant storage
- CSo that metrics appear faster in the experiment UI, since the run is indexed by its data version tag
- DBecause MLflow refuses to record a run unless a data version has been attached to the run beforehand
Show answer and explanationHide answer
Correct answer: ARecording the data version ties each model to the exact data it learned from, which is essential for reproducibility and for explaining changes between versions. It does not reduce artifact size, speed up the UI, or act as a precondition for logging a run.
Question 18
What does the Unity Catalog model registry provide that a workspace-local registry does not?
- AFree model hosting outside the Databricks platform, which the team can use without any compute charges
- BA faster GPU for inference, because the registry places the model on accelerators in the region closest to the users of the model
- CAutomatic deletion of old runs after a fixed number of days, so that the experiment list stays short
- DGovernance across workspaces, with permissions and lineage recorded for registered models and their versions
Show answer and explanationHide answer
Correct answer: DUnity Catalog centralizes model governance, so access controls and lineage apply consistently across workspaces. Hardware speed, automatic run deletion, and free external hosting are not features of the registry.
Question 19
A newly promoted model version degrades production metrics. What is the best immediate action?
- APoint the serving alias back to the previous good version while the new version is investigated
- BDelete the registry entry for the whole model so that no version can be served until the issue is fixed
- CWait a full week to collect more production data before taking any action on the degraded metrics
- DRetrain on the same data without any changes to see whether the degradation is a random fluctuation
Show answer and explanationHide answer
Correct answer: ARepointing the alias to the last good version restores service quickly and keeps the faulty version available for analysis. Deleting the model, waiting, or retraining unchanged each leave users with degraded predictions for longer.
Question 20
Which two Databricks features help automate retraining with alerting when a run fails? (Choose two.)
- ALakeflow Jobs with a schedule and failure notifications sent to the responsible team members
- BA notebook that a person opens manually each Monday to start the retraining run by hand
- CJob run history with retry settings that rerun a failed task a set number of times
- DThe query history of a SQL warehouse, which records the statements that analysts have run
- EDriver logs from a single interactive cluster that was used for development in the workspace
Show answer and explanationHide answer
Correct answer: A, CScheduled jobs with failure notifications automate retraining and alert the owners, and retry settings handle transient failures without manual action. Manual notebooks, warehouse query history, and interactive driver logs do not automate or alert on the retraining workflow.
Model Deployment (10 questions)
Question 21
Which two conditions favor batch inference over a real-time endpoint? (Choose two.)
- APredictions are needed for millions of rows on a nightly schedule, with no per-request latency requirement
- BEach prediction must return within a few hundred milliseconds in response to a user request on a website
- CThe results are written to a Delta table for later reporting and analytics by the business teams involved
- DThe model is called once per user click from a web application that runs the scoring for every visitor
- EPredictions must be shown in a browser form one row at a time as each row is entered by a user
Show answer and explanationHide answer
Correct answer: A, CLarge scheduled scoring with no latency target is well suited to batch jobs, and writing results to a table serves reporting directly. Sub-second per-request latency, per-click calls, and one-row-at-a-time forms all need an online endpoint instead.
Question 22
Which feature serves a registered model as a REST endpoint with autoscaling on Databricks?
- AThe DBFS root directory, which stores files for the workspace but does not serve any model requests
- BMosaic AI Model Serving endpoints, which expose a registered model behind a managed REST API
- CThe Delta Sharing server, which shares tables with external recipients through a secure open protocol
- DThe Jobs API run log, which records the status and output of each job run in the workspace over time
Show answer and explanationHide answer
Correct answer: BMosaic AI Model Serving exposes registered models as managed REST endpoints with autoscaling. The DBFS root, Delta Sharing, and the Jobs API log store or share data and job information rather than serving predictions.
Question 23
Which deployment strategy sends a small share of traffic to a new model version before a full rollout?
- AA canary deployment, which splits traffic between the current and the new version and watches the results
- BA big-bang replacement, which moves all traffic to the new version at the same moment it is deployed to the endpoint for users
- CA blue-green switch without any testing period, which changes all traffic over immediately after the copy
- DRecreating the endpoint every night, so that each new version starts from a clean state on schedule
Show answer and explanationHide answer
Correct answer: AA canary deployment exposes only part of the traffic to the new version so that its behaviour can be checked before a full rollout. Big-bang, untested blue-green, and nightly recreation all move every user at once or skip validation.
Question 24
Which two checks should run before a served model is promoted to receive production traffic? (Choose two.)
- AInput signature compatibility with the request payloads that the client applications will send
- BLatency and error rate measured under a load test that reflects the expected production traffic
- CThe colour assigned to the endpoint in the dashboard, so that operators can see its status at a glance
- DThe length of the model file name, which must stay below a fixed limit for the serving platform
- EThe years of experience that the model's author has in data science and machine learning projects
Show answer and explanationHide answer
Correct answer: A, BSignature compatibility catches request mismatches, and load testing verifies latency and errors under realistic traffic before users depend on the endpoint. Dashboard colours, file name length, and author experience do not reflect whether the model will serve correctly.
Question 25
A custom model needs a Python dependency that is not in the default serving image. What should the team do?
- ADisable the dependency checks for the endpoint so that the model can start serving without the missing package being installed
- BInstall the package on a laptop and copy its site-packages folder into the endpoint when it is deployed
- CDeclare the dependency in the environment logged with the model so that the serving image is built with it
- DServe the model from the notebook instead of an endpoint, so that the local packages remain available
Show answer and explanationHide answer
Correct answer: CLogging the required dependencies with the model lets the serving environment build with them, which keeps the deployment reproducible. Copying a laptop's packages, disabling checks, and serving from a notebook all bypass the dependency record and break reproducibility.
Question 26
Which endpoint setting controls how much capacity an endpoint can scale between when traffic changes?
- AThe autoscaling configuration with minimum and maximum capacity for the served model
- BThe notebook default language that is chosen for the workspace and shared across all of its users
- CThe workspace time zone that determines how the timestamps of the logs are displayed to the users
- DThe name of the catalog that holds the registered model, which is used when the endpoint is created
Show answer and explanationHide answer
Correct answer: AMinimum and maximum capacity in the autoscaling configuration define how far the endpoint can scale with demand. The notebook language, time zone, and catalog name are not capacity settings.
Question 27
Clients of a served model receive 400 errors after a deployment. What should be checked first?
- AThe request payload against the input signature that was logged with the model when it was registered
- BThe cluster's notebook history, which lists the cells that were run on the cluster in the last few days
- CThe colour theme of the endpoint dashboard, which can affect how the error messages are shown to users
- DThe year in which the model was trained, because older models are more likely to return client errors
Show answer and explanationHide answer
Correct answer: AA 400 response indicates the request does not match what the endpoint expects, so comparing the payload to the logged signature is the fastest test. Notebook history, dashboard themes, and training year do not explain a malformed request.
Question 28
Which deployment strategy keeps the previous version running so that the team can switch back immediately?
- AOverwriting the existing endpoint in place with the new model, with no backup copy of the previous version
- BDeleting the old version before the new version is deployed, so that only one version exists at any time
- CBlue-green deployment, which keeps the old endpoint or version running until the new one is confirmed healthy
- DRenaming the old version to a random string so that it cannot be reached by any client by accident again
Show answer and explanationHide answer
Correct answer: CBlue-green deployment keeps a known-good version live until the replacement is verified, so a switch back is immediate. Deleting, overwriting in place, or renaming the old version all remove the fast path back to a working state.
Question 29
Which signal should trigger an automatic rollback in a deployment policy?
- AA rise in the number of users who mark the notebook as a favourite in the workspace folder they share
- BA sustained rise in error rate or latency above thresholds that the team agreed in advance for the endpoint
- CA change in the modification date of the README file that describes the model and how it should be used
- DAn increase in the number of tags that have been attached to the registered model over the last month
Show answer and explanationHide answer
Correct answer: BError rate and latency against agreed thresholds directly show that the new version is harming users, which justifies an automatic rollback. Notebook favourites, README dates, and tag counts say nothing about how the endpoint is performing.
Question 30
Which setting defines the traffic split between two served versions of the same model on an endpoint?
- AThe workspace language setting that controls the labels shown on the endpoint page for its users
- BThe traffic configuration that assigns percentages to each served model version on the endpoint
- CThe catalog owner field, which records the person or group that is responsible for the schema
- DThe cluster Spark version, which defines the runtime that the cluster uses for its background work
Show answer and explanationHide answer
Correct answer: BThe traffic configuration assigns percentages to served entities, which is how a canary or A/B split is set up on an endpoint. Language, Spark runtime, and catalog ownership settings do not control how requests are divided between versions.