All Databricks exams

Free Databricks Certified Machine Learning Associate practice test: 30 questions with answers

30 original questions for Databricks Certified Machine Learning Associate, 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 Associate exam guide: topics, cost and format

All 30 Databricks Certified Machine Learning Associate questions with answers

The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.

Databricks Machine Learning (8 questions)

  1. Question 1

    A data scientist wants each training run's parameters, metrics and model artifacts recorded so that runs in a workspace can be compared later. Which tool provides this?

    1. AUnity Catalog lineage, which records which tables and notebooks a particular query has read
    2. BDelta Lake time travel, which restores an earlier version of a table to a previous state
    3. CMLflow Tracking, which logs parameters, metrics and artifacts for each run in an experiment
    4. DDatabricks Connect, which runs local Python code against a remote cluster for interactive work
    Show answer and explanation
    Correct answer: C

    MLflow Tracking records parameters, metrics and artifacts for every run in an experiment, so runs can be compared in the workspace. Delta time travel and Unity Catalog lineage concern tables and data access rather than model runs. Databricks Connect runs code remotely and does not record experiment results.

  2. Question 2

    A team wants Databricks to train and compare several candidate models on a labelled table, then generate notebooks containing the code for each candidate. Which feature does this?

    1. ADatabricks Repos, which syncs notebooks with a remote Git repository for version control
    2. BAutoML, which trains and compares candidate models and generates notebooks
    3. CDatabricks SQL warehouses, which serve queries to dashboards and BI tools for analysts
    4. DUnity Catalog volumes, which store unstructured files such as images for later training
    Show answer and explanation
    Correct answer: B

    AutoML trains and compares candidate models on a dataset and generates notebooks that reproduce each one, which saves the team from writing the baseline pipelines by hand. Repos handles source control, SQL warehouses serve queries, and volumes store files. None of them trains and compares candidate models.

  3. Question 3

    Which statement about the Databricks Runtime for Machine Learning is correct?

    1. AIt bundles common machine learning libraries, such as scikit-learn and XGBoost, on clusters
    2. BIt is available only on SQL warehouses and cannot be used to run notebooks or scheduled jobs
    3. CIt removes the need for Apache Spark, because the libraries run on a single node only
    4. DIt replaces MLflow with a proprietary tracking service that is incompatible with open-source tools
    Show answer and explanation
    Correct answer: A

    The Databricks Runtime for Machine Learning ships common ML libraries, including scikit-learn, XGBoost and MLflow, pre-installed on clusters with Spark. It is used on clusters that run notebooks and jobs, not on SQL warehouses. It keeps Spark and works with open-source MLflow rather than replacing it.

  4. Question 4

    A team registers its models in Unity Catalog. Which name format must it use for a registered model?

    1. AA three-level catalog.schema.model name that defines where the registered model lives
    2. BA Git commit hash that identifies the notebook used to train the model for each version
    3. CA timestamp-based identifier that the tracking server generates automatically for every run
    4. DA plain model name with no catalog or schema, which is stored in the workspace registry only
    Show answer and explanation
    Correct answer: A

    Models in Unity Catalog are named with the three-level catalog.schema.model format, which places them under the same governance as tables. A plain name belongs to the older workspace registry, a commit hash identifies code rather than the model, and a timestamp is a run identifier rather than a registered model name.

  5. Question 5

    Which Feature Engineering in Unity Catalog capability lets several training jobs and online serving reuse the same features?

    1. AFeature tables in Unity Catalog, which store features with primary keys for lookup
    2. BLocal pandas DataFrames saved to each notebook's workspace folder so that each user keeps a private copy
    3. CTemporary views created in each notebook session and dropped automatically when that session ends
    4. DSpark broadcast variables, which hold a copy of the feature values on every worker node in the cluster
    Show answer and explanation
    Correct answer: A

    Feature tables in Unity Catalog store features with primary keys, so training and serving can look up the same feature values. Private DataFrames and session views are not shared or governed. Broadcast variables are memory copies used inside one Spark job and disappear when it ends.

  6. Question 6

    A data scientist must score a logged MLflow model against a large Spark DataFrame at scale. Which function is designed for this?

    1. Amlflow.sklearn.load_model, which loads the model only into the driver's local memory for scoring
    2. Bpandas.read_csv, which reads the full DataFrame into the driver before scoring it row by row
    3. Cmlflow.pyfunc.spark_udf, which wraps the model as a Spark UDF that scores in parallel
    4. Dspark.read.table, which loads the features from a table and cannot apply a model to them
    Show answer and explanation
    Correct answer: C

    mlflow.pyfunc.spark_udf wraps a logged model as a Spark UDF, so scoring runs in parallel on the executors and scales with the cluster. Loading a scikit-learn model with load_model keeps scoring on the driver. Reading data into pandas on the driver and spark.read.table do not provide distributed model application.

  7. Question 7

    In a Spark ML pipeline, which stage converts a categorical string column into numeric indices?

    1. AVectorAssembler, which combines several numeric columns into a single feature vector column
    2. BTokenizer, which splits a text string into a list of individual words for further processing
    3. CNormalizer, which scales each feature vector so that it has unit norm for distance calculations
    4. DStringIndexer, which maps each distinct string value to a numeric index
    Show answer and explanation
    Correct answer: D

    StringIndexer maps each distinct string value to a numeric index, which models can then use. VectorAssembler combines columns that are already numeric, Tokenizer splits text into words, and Normalizer rescales vectors. None of them converts string categories to indices.

  8. Question 8

    A model is trained on a Delta table, and the team must be able to reproduce the training data months later. Which combination best supports this?

    1. AStoring the training code only in a notebook cell output, without recording which data version was used
    2. BLogging the MLflow run with its parameters and the Delta table version that the model was trained on
    3. CSaving the model file to a laptop and deleting the training data once the run has completed successfully
    4. DRe-running the notebook later against the latest table version, on the basis that results are deterministic
    Show answer and explanation
    Correct answer: B

    Logging the run's parameters together with the Delta table version it used lets the team recreate the exact training data with time travel and rerun the same settings. Re-running against the latest version gives different data if the table has changed. Deleting the training data removes the ability to reproduce the model.

Model Development (8 questions)

  1. Question 9

    A binary classifier is trained on data where the positive class is very rare. Which evaluation metric is most informative?

    1. AAccuracy, which measures the share of all predictions that match the true label
    2. BMean squared error, which measures the average squared difference between the predicted and actual values
    3. CArea under the precision-recall curve, which focuses on how well the rare positive class is found
    4. DR-squared, which measures the share of variance explained, for continuous regression targets
    Show answer and explanation
    Correct answer: C

    With a rare positive class, accuracy can look high even when the model misses most positives, while the precision-recall curve shows how well positives are found. Mean squared error and R-squared are regression measures and do not suit a binary classifier.

  2. Question 10

    A Spark ML hyperparameter search must evaluate each parameter combination across several folds of the training data. Which class performs this?

    1. AVectorAssembler, which builds the feature vector for each row of the training data
    2. BCrossValidator, which evaluates each parameter combination across k folds
    3. CTokenizer, which splits each text value into individual tokens for downstream stages
    4. DIndexToString, which maps numeric predictions back to their original string labels
    Show answer and explanation
    Correct answer: B

    CrossValidator evaluates each parameter combination across k folds and selects the best one, which is the k-fold search described. VectorAssembler, Tokenizer and IndexToString are pipeline transformers and do not run a search over parameters.

  3. Question 11

    A model scores much higher on its training data than on the validation data. Which problem is most likely?

    1. AUnderfitting, because the model is too simple to capture the real signal in the training data
    2. BData leakage from the validation set into training, which inflates the score on the training data
    3. COverfitting, because the model has learned noise in the training data that does not generalise
    4. DA learning rate that is set too high, which makes the training score rise faster than normal
    Show answer and explanation
    Correct answer: C

    A large gap between training and validation scores means the model has fitted noise in the training data that does not carry over, which is overfitting. Underfitting gives low scores on both sets. Leakage from validation into training would inflate validation scores as well, and a high learning rate does not explain the gap.

  4. Question 12

    A team wants to version its models and promote a specific version for review. Which MLflow component manages this?

    1. AThe MLflow Tracking server, which records only the metrics of each run for later comparison
    2. BMLflow Projects, which packages code so that it can be run in a reproducible environment
    3. CMLflow Model Registry, which tracks model versions and aliases for review and promotion
    4. DDelta Sharing, which shares tables with external recipients who need read-only access to them
    Show answer and explanation
    Correct answer: C

    The MLflow Model Registry stores model versions with aliases and stages so that a chosen version can be reviewed and promoted. Projects packages code, Tracking records run metrics, and Delta Sharing shares data. None of them manages model versions for promotion.

  5. Question 13

    A team needs to tune a model over a large search space with a Bayesian-style method, and it must record every trial. Which approach fits?

    1. AHyperopt's fmin with the tpe.suggest algorithm, logging each trial to MLflow as the search runs
    2. BA nested for-loop over every combination in a fixed grid, with no logging of the individual trials
    3. CA manual trial-and-error process run in separate notebooks, with no shared record of the results
    4. DA random seed set once at the start, which changes the model each time it is trained
    Show answer and explanation
    Correct answer: A

    Hyperopt's fmin with tpe.suggest is a Bayesian-style search that chooses promising trials based on earlier results, and logging each trial to MLflow keeps a record. A fixed grid is exhaustive and slow over a large space. Manual notebooks lack a shared record, and a seed does not perform any search.

  6. Question 14

    Which statement about feature scaling for distance-based models, such as k-nearest neighbours, is correct?

    1. AScaling is never needed, because distances are unaffected by the magnitude of each feature value
    2. BFeatures with very different scales can dominate distances, so inputs are usually scaled
    3. CScaling matters only for tree-based models, and it has no effect on distance-based models at all
    4. DScaling should be applied only to the target variable, leaving all of the input features unchanged
    Show answer and explanation
    Correct answer: B

    Distance-based models compare feature magnitudes directly, so a feature with a large range can dominate the distance and distort neighbours. Scaling the inputs usually corrects this. Scaling does not apply only to trees, and scaling the target alone does not fix the distance problem.

  7. Question 15

    A team must record the expected input and output schema of a model, so that consumers can call it correctly. Which MLflow capability provides this?

    1. ADelta Live Tables expectations, which validate the rows that each pipeline table receives
    2. BAuto Loader schema hints, which describe the expected column types of incoming files for ingestion
    3. CUnity Catalog column masks, which hide sensitive column values from users without the right privilege
    4. DA model signature logged with the model, which records its input and output schema
    Show answer and explanation
    Correct answer: D

    A model signature logged with the model records the input and output schema, so consumers and serving can validate calls. Delta Live Tables expectations and Auto Loader hints concern pipeline data, and column masks control access to sensitive values. None of them describes a model's interface.

  8. Question 16

    Which Spark ML estimator is built for regression on tabular data with a continuous target?

    1. ALinearRegression, which fits a linear model to a continuous target column
    2. BKMeans, which clusters unlabelled rows into a fixed number of groups
    3. CFPGrowth, which finds frequent itemsets in transaction data for association analysis
    4. DALS, which builds collaborative filtering recommendations from user-item ratings
    Show answer and explanation
    Correct answer: A

    LinearRegression in pyspark.ml fits a linear model to a continuous target, which is the regression task described. KMeans clusters unlabelled data, FPGrowth finds itemsets, and ALS produces recommendations. None of them predicts a continuous label.

Data Processing (7 questions)

  1. Question 17

    A dataset has missing values in a numeric column, and the team wants to fill them with the median inside a Spark ML pipeline. Which transformer does this?

    1. AStandardScaler, which scales each value to unit variance around the mean of the column
    2. BBucketizer, which assigns each value to one of a fixed set of ranges defined by split points
    3. COneHotEncoder, which creates a binary column for each distinct value in a categorical column
    4. DImputer, which replaces missing values with the mean or median of each column
    Show answer and explanation
    Correct answer: D

    The Imputer transformer fills missing values with the mean or median of each column, which matches the requirement. StandardScaler rescales values, OneHotEncoder encodes categories, and Bucketizer groups values into ranges. None of them fills missing values.

  2. Question 18

    Which Delta Lake feature lets a team read a table as it was at an earlier point, so that it can recreate the data used for a model?

    1. AZ-ordering, which co-locates related rows in the same files to speed up selective queries
    2. BAuto Loader, which incrementally ingests new files arriving in cloud storage into a table
    3. CLiquid clustering, which reorganises the data over time according to the chosen clustering keys
    4. DTime travel, which queries an earlier table version by version number or by timestamp
    Show answer and explanation
    Correct answer: D

    Time travel queries an earlier version of a Delta table by version number or timestamp, which allows the training data to be recreated exactly. Z-ordering and liquid clustering improve query performance, and Auto Loader handles ingestion. None of them returns an earlier version of the data.

  3. Question 19

    A data scientist wants pandas-style code that runs distributed across a large dataset in Spark, without collecting everything onto one node. Which option fits?

    1. AThe pandas API on Spark, which runs pandas-style operations distributed across the cluster
    2. BNumPy arrays created on each worker before any aggregation, combined manually at the end
    3. CThe Python csv module, which reads each file row by row into memory on a single machine
    4. Dpandas on the driver only, after collecting the whole Spark DataFrame to a single node first
    Show answer and explanation
    Correct answer: A

    The pandas API on Spark keeps pandas syntax while executing operations distributed across the cluster. Collecting data to the driver puts the whole dataset on one node, which fails at scale. NumPy on workers and row-by-row csv reading do not provide distributed pandas-style processing.

  4. Question 20

    New JSON files land in cloud storage every few minutes, and a pipeline must ingest them incrementally into a table. Which Databricks feature handles this?

    1. AA Databricks SQL dashboard that refreshes the ingested data whenever a user opens the dashboard
    2. BA nightly full reload with spark.read in overwrite mode, reprocessing the entire folder every night
    3. CAuto Loader, which detects new files and processes each one incrementally into the target table
    4. DDatabricks Repos, which pulls the latest JSON files from the Git repository on each pipeline run
    Show answer and explanation
    Correct answer: C

    Auto Loader detects newly arrived files and ingests only those, which suits frequent arrivals without reprocessing the folder. A nightly full reload repeats work and is slower. Dashboards display data rather than ingest it, and Repos manages code rather than data files.

  5. Question 21

    Which TWO are benefits of storing training data in Delta tables? (Choose two.)

    1. AData is stored as plain text files with no schema, which speeds up every write operation
    2. BACID transactions protect readers from seeing partially written data during an update
    3. CEvery update or delete must rewrite the entire dataset, so that changes are always complete
    4. DSchema enforcement rejects writes that do not match the table's defined schema
    5. EDelta tables cannot be read by Spark jobs that run on clusters other than the one that wrote them
    Show answer and explanation
    Correct answer: B, D

    ACID transactions mean readers never see partial writes, and schema enforcement stops mismatched data from entering the table. Delta tables store data in columnar files with a transaction log, so updates do not rewrite the entire dataset. Delta tables are readable by any Spark job with access to them.

  6. Question 22

    A Spark DataFrame stores timestamps as strings, and the team needs to compute the duration between two of them. Which action is needed first?

    1. ADrop the timestamp column, since string values cannot be used in any date or time calculation
    2. BCast the string column to a timestamp type before computing the differences between the values
    3. CTreat the column as a categorical feature with StringIndexer, then compute durations from the indices
    4. DConvert the column to JSON and count its characters, using the counts as an estimate of each duration
    Show answer and explanation
    Correct answer: B

    Casting the strings to a timestamp type lets Spark compute differences between the values correctly. Dropping the column loses the data the team needs. Indexing a string column produces category numbers, not durations, and counting characters in JSON has no relation to elapsed time.

  7. Question 23

    Which mechanism lets a SQL user query a Delta table and cloud-stored files as tables in the same statement?

    1. ADatabricks Connect, which runs one query at a time from a local session on the user's laptop
    2. BDatabricks Repos, which pulls query files from a Git repository into the workspace for execution
    3. CLakehouse Federation or external tables, which expose data in other sources as queryable tables
    4. DManual export of each source to CSV files before every join, so that all data sits in one place
    Show answer and explanation
    Correct answer: C

    External tables expose files in cloud storage as tables, and Lakehouse Federation exposes other data sources, so both can be joined with Delta tables in one SQL statement. Databricks Connect and Repos do not query other sources in this way. Manual exports add effort and create copies that drift.

Model Deployment (7 questions)

  1. Question 24

    A team wants predictions for every row of a large table written to a Delta table each night. Which deployment pattern is appropriate?

    1. AA real-time serving endpoint that the nightly job calls once for each individual row of the table
    2. BA dashboard that scores each row again every time a user opens the page in the browser
    3. CA notebook that a person runs manually whenever a prediction is needed for a customer request
    4. DBatch inference that loads the registered model and writes the predictions to a Delta table
    Show answer and explanation
    Correct answer: D

    Batch inference scores the whole table in one job and writes predictions to a Delta table, which suits a nightly schedule. Calling a real-time endpoint row by row is slow and costly at that volume. Manual notebooks and dashboards do not produce a reliable nightly output.

  2. Question 25

    A web application needs a prediction within milliseconds for each individual request. Which Databricks option fits?

    1. AA nightly batch job that writes predictions to a table, so that the application can look them up later
    2. BA notebook scheduled every hour that prints predictions to its output cell for the application to read
    3. CA Model Serving endpoint, which hosts the registered model for low-latency REST requests
    4. DA Delta Live Tables pipeline that refreshes the predictions once each day for all customers
    Show answer and explanation
    Correct answer: C

    A Model Serving endpoint hosts the registered model behind a REST API for low-latency requests, which matches per-request predictions. Nightly batch tables and hourly notebooks cannot answer a new request within milliseconds. A daily pipeline refresh has the same limitation.

  3. Question 26

    Which TWO are appropriate considerations when deploying a model to production? (Choose two.)

    1. AMonitoring prediction drift and model performance after the model has been deployed
    2. BRetraining the model on the production server without recording which data version was used
    3. CServing the model without any input validation, so that latency stays as low as possible
    4. DDeploying a model version that has not been evaluated on held-out data first
    5. EPinning the model version and its dependencies so that serving is reproducible over time
    Show answer and explanation
    Correct answer: A, E

    Monitoring drift and performance after release shows when a model stops working as expected, and pinning the version and dependencies keeps serving reproducible. Retraining without recording the data version breaks reproducibility. Deploying without evaluation or validation exposes users to untested behaviour.

  4. Question 27

    A mobile application sends JSON requests to a model endpoint. Which MLflow concept defines the input format that the endpoint should accept?

    1. AThe model signature, which records the input schema that the endpoint can validate each request against
    2. BThe Spark version of the cluster, which determines the data types that the model accepts as inputs
    3. CThe model's run ID, which identifies the training run in the tracking server for auditing purposes
    4. DThe experiment name, which groups the runs in the workspace UI so that they are easy to find later
    Show answer and explanation
    Correct answer: A

    The model signature records the input and output schema, and the endpoint can validate incoming JSON against it. A run ID, the cluster's Spark version and an experiment name do not define the request format a model accepts.

  5. Question 28

    A team wants to roll out a new model version gradually, sending only a small share of traffic to it at first. Which serving feature supports this?

    1. AA batch job that rescores the whole table before any user is able to see the new model version
    2. BA notebook that the team runs manually each morning to switch the endpoint over to the new version
    3. CTraffic splitting across served model versions on the same endpoint, with a percentage for each version
    4. DDeleting the old model before deploying the new one, so that version conflicts cannot occur at all
    Show answer and explanation
    Correct answer: C

    Traffic splitting across served versions on one endpoint sends a set percentage of requests to the new version, which supports a gradual rollout. Batch rescoring and manual notebook switches do not route live traffic, and deleting the old model first removes the fallback.

  6. Question 29

    Which TWO are appropriate design choices for a model used in a batch scoring job? (Choose two.)

    1. APartitioning the input data so that scoring runs in parallel across the executors of the cluster
    2. BScoring rows one at a time through a REST call issued from a loop in the driver program
    3. CWriting the predictions to a Delta table with a clearly defined schema for downstream consumers
    4. DLoading the full model onto the driver and iterating over each row in plain Python for scoring
    5. ERetraining the model inside the scoring job on every run, so that it always uses the newest data
    Show answer and explanation
    Correct answer: A, C

    Partitioned input lets the executors score in parallel, and a Delta table with a defined schema gives downstream consumers a stable output. Row-by-row REST calls and driver-only Python loops are slow at batch volume. Retraining inside the scoring job makes results depend on each run's data and adds cost.

  7. Question 30

    A team needs predictions in under 100 milliseconds for individual requests from its application. Which option is the best fit?

    1. AA batch job that writes predictions nightly to a table, so that the application can query them later
    2. BA scheduled Delta Live Tables pipeline that refreshes the predictions every six hours for all rows
    3. CA notebook that runs the model each time a user refreshes a dashboard in the browser
    4. DA real-time serving endpoint with the registered model deployed and autoscaling enabled
    Show answer and explanation
    Correct answer: D

    A real-time serving endpoint with autoscaling hosts the model for low-latency requests and scales with traffic. Nightly tables, dashboard-triggered notebooks and six-hourly pipelines cannot answer an individual request within milliseconds.