Databricks Machine Learning Associate Practice Exam
Databricks Certified Machine Learning Associate
The Databricks Certified Machine Learning Associate certification validates the ability to use Databricks to perform basic machine learning tasks, including AutoML, Unity Catalog and MLflow. The exam covers four sections: Databricks Machine Learning (38%), Data Processing (19%), Model Development (31%) and Model Deployment (12%). Questions test feature tables, experiment tracking and model registration, imputation and encoding, tuning and cross-validation, evaluation metrics and batch, streaming and real-time serving. This practice exam mirrors that style with single-answer and multiple-selection questions, many built around short scenarios and code snippets.
600 questions in the bank
Question bank updated : questions, answers, explanations and chapters.
Certification Overview
- Exam name: Machine Learning Associate
- Vendor: Databricks
- Duration: 90 minutes
- Total questions: about 48
- Our practice exam pass mark: 70%
Who Should Take This Exam?
Machine Learning Engineer, Data Scientist, ML Ops Engineer, Data Engineer, Applied Scientist, Analytics Engineer, AI Engineer, Python Developer
Prerequisites
No formal prerequisite. Databricks highly recommends related training and six months of hands-on experience with the Databricks Platform and the tasks in the exam outline.
Topics Covered
- Databricks Machine Learning
- Data Processing
- Model Development
- Model Deployment
Question Types
- Multiple Choice (Single Answer)
- Multiple Choice (Multiple Answers)
Machine Learning Associate Practice Questions
Our question bank contains 600+ practice questions for this certification. Sample questions from each exam chapter. Expand a question to see the answer choices. With full access, you get unlimited practice exams with randomized questions from our full question bank.
Databricks Machine Learning
Which practice is part of a sound MLOps strategy on Databricks?
- A. Copy notebooks between workspaces by hand after each change
- B. Develop and test directly in the production workspace to avoid drift
- C. Keep code in Git and track runs and models with MLflow Correct answer
- D. Share one all-purpose cluster for training, testing and serving
Option C is correct because keeping code in Git and tracking runs and models with MLflow gives a reproducible, auditable workflow. Hand-copying notebooks, developing in production and sharing one all-purpose cluster for training, testing and serving all remove isolation and repeatability, so they are not sound MLOps practice.
A machine learning engineer has a Spark DataFrame features_df keyed by customer_id. The table must be registered as a feature table in Unity Catalog, in catalog ml and schema shop, with the name customer_features. The client is fe = FeatureEngineeringClient(). Which call creates the table?
- A. fe.create_table(name="ml.shop.customer_features", primary_keys=["customer_id"], df=features_df) Correct answer
- B. fe.create_table(name="ml.shop.customer_features", keys=["customer_id"], df=features_df)
- C. fe.write_table(name="ml.shop.customer_features", df=features_df, mode="merge")
- D. fe.create_feature_table(name="ml.shop.customer_features", keys=["customer_id"], features_df=features_df)
Option A is correct because FeatureEngineeringClient.create_table takes the full three-level Unity Catalog name, a primary_keys list and the source DataFrame in df. Option B uses a keys argument that create_table does not have, option C writes to a table that does not exist yet, and option D calls a method name that belongs to the older workspace feature store client.
Experiment 42 holds four runs, shown with short names for readability: run_a1 (rmse 3.9, r2 0.80), run_b2 (rmse 4.2, r2 0.91), run_c3 (rmse 4.8, r2 0.88) and run_d4 (rmse 6.1, r2 0.95). The team wants the run with the highest r2 among runs whose rmse is below 5, and executes: runs = mlflow.search_runs( experiment_ids=["42"], filter_string="metrics.rmse < 5", order_by=["metrics.r2 DESC"], ) What is the value of runs.loc[0, "run_id"]?
- A. run_c3
- B. run_d4
- C. run_b2 Correct answer
- D. run_a1
Option C is correct because the filter metrics.rmse < 5 keeps run_a1 (3.9), run_b2 (4.2) and run_c3 (4.8) and drops run_d4 (6.1). Ordering by r2 descending puts run_b2 (0.91) first, ahead of run_c3 (0.88) and run_a1 (0.80), so row 0 is run_b2. Run_d4 has the highest r2 overall but is excluded by the rmse filter.
Model ml.shop.churn in the Unity Catalog registry has version 3 with the alias champion and version 5 with the alias challenger. Validation is finished and version 5 must now serve as champion. With client = MlflowClient(registry_uri="databricks-uc"), which call does this?
- A. client.set_registered_model_alias("ml.shop.churn", "champion", 5) Correct answer
- B. client.transition_model_version_stage("ml.shop.churn", 5, "Production")
- C. client.delete_registered_model_alias("ml.shop.churn", "challenger")
- D. client.set_model_version_tag("ml.shop.churn", 5, "alias", "champion")
Option A is correct because set_registered_model_alias(name, alias, version) points the alias at the given version, and an alias can reference only one version, so champion moves from version 3 to version 5. Stage transitions are not supported for Unity Catalog models, deleting challenger does not set champion, and a tag named alias does not create a real alias.
Why should training code for a Databricks ML project live in a Git repository linked through Git folders?
- A. Changes are versioned and reviewed, and each run can be traced to a commit Correct answer
- B. Commits to the repository retrain registered models without a job
- C. Notebook cells compile into a JAR, which shortens cluster start time
- D. Git folders store the trained model files, so no model registry is needed
Option A is correct because Git folders link the notebooks and code to a remote repository, so every change is versioned and reviewed, and a run records the commit it used. A commit does not retrain or register models by itself, notebooks do not compile into a JAR, and Git does not replace the model registry.
Data Processing
The monthly_spend column is right-skewed, with a few very large values, and 8 percent of its rows are null. A data scientist fills the nulls with a Spark ML Imputer. Which setting gives a filled value close to a typical customer?
- A. Imputer(strategy="mean")
- B. Imputer(strategy="median") Correct answer
- C. Imputer(strategy="mode")
- D. df.fillna(0, subset=["monthly_spend"])
Option B is correct because the median is not pulled up by a few very large values, so it stays close to a typical customer in a right-skewed column. The mean is dragged upward by the large values, the mode is a poor summary for a continuous spend value, and filling with 0 would understate spend for every customer with a missing value.
The Spark DataFrame df has a numeric column price. The values q1 and q3 come from df.approxQuantile("price", [0.25, 0.75], 0.01), and iqr = q3 - q1. Which filter removes the outliers by the standard 1.5 x IQR rule?
- A. df.filter(~F.col("price").between(q1 - 1.5 * iqr, q3 + 1.5 * iqr))
- B. df.filter(F.col("price").between(q1 + 1.5 * iqr, q3 - 1.5 * iqr))
- C. df.filter(F.col("price").between(q1 - 1.5 * iqr, q3 + 1.5 * iqr)) Correct answer
- D. df.filter(F.col("price").between(q1 - iqr, q3 + iqr))
Option C is correct because the 1.5 x IQR rule treats values below q1 - 1.5 x iqr or above q3 + 1.5 x iqr as outliers, so keeping rows between those fences removes them. Option A keeps only the outliers, option B swaps the bounds so nothing can match, and option D uses a 1.0 multiplier instead of 1.5.
A retail DataFrame has a string column payment_method with 5 unordered values and a numeric column customer_age. Which TWO statements about preparing these columns for Spark ML models are correct?
- A. OneHotEncoder takes the raw string column as input, then indexes it internally
- B. customer_age needs one-hot encoding before a linear model can use it
- C. A random forest can split on StringIndexer output, so one-hot encoding is optional Correct answer
- D. StringIndexer maps a payment_method value unseen in training to an extra index by default
- E. payment_method suits one-hot encoding before a logistic regression is fitted Correct answer
Options C and E are correct because tree-based models like a random forest can split on StringIndexer output, so one-hot encoding is optional there, while a logistic regression would wrongly read the indices of unordered categories as an order, so payment_method suits one-hot encoding. OneHotEncoder takes the indexed numeric column, not the raw string. A numeric column such as customer_age needs no encoding, and StringIndexer raises an error on unseen values by default.
What does df.summary() return by default that df.describe() leaves out?
- A. The 25%, 50% and 75% percentile rows Correct answer
- B. The mode and variance rows
- C. The null count and distinct count rows
- D. The skewness and kurtosis rows
Option A is correct because df.summary() adds the approximate 25%, 50% and 75% percentile rows to the count, mean, stddev, min and max rows that df.describe() returns. Mode, variance, null count, distinct count, skewness and kurtosis are not part of either output.
Which call renders a per-column profile of df, with histograms for numeric columns, in a Databricks notebook?
- A. display(df.describe())
- B. df.limit(100).printSchema()
- C. df.summary().explain()
- D. dbutils.data.summarize(df) Correct answer
Option D is correct because dbutils.data.summarize(df) renders a per-column profile in a Databricks notebook, with histograms for numeric columns. display(df.describe()) only shows a table of five statistics, printSchema() lists column names and types, and explain() prints a query plan.
Model Development
An engineer wants Hyperopt to evaluate 32 candidate settings with the TPE algorithm and keep every trial's loss for later inspection. Which call does this?
- A. fmin(fn=objective, space=space, algo=rand.suggest, max_evals=32, trials=Trials())
- B. fmin(fn=objective, space=space, algo=tpe.suggest, max_evals=32, trials=Trials()) Correct answer
- C. fmin(fn=objective, space=space, algo=tpe.suggest, max_evals=32)
- D. fmin(fn=objective, space=space, algo=tpe.suggest, n_iter=32, trials=Trials())
Option B is correct because algo=tpe.suggest selects the TPE algorithm, max_evals=32 sets the number of evaluations, and passing a Trials() object keeps the loss and other details of every trial. Option A uses random search, option C has no Trials object to inspect, and option D uses n_iter, which is not an fmin argument.
A data scientist builds a Spark ML CrossValidator with numFolds=4 around a LogisticRegression. The ParamGridBuilder sets regParam to 3 values, elasticNetParam to 2 values and maxIter to 3 values, and the cluster trains 2 models in parallel. How many models are trained in total, counting the final refit of the best setting on the full training data?
- A. 18
- B. 24
- C. 72
- D. 73 Correct answer
Option D is correct because the grid has 3 x 2 x 3 = 18 settings, and with 4 folds each setting is trained 4 times, giving 72 models. The final refit of the best setting on the full training data adds 1 more, so 73. The parallelism of 2 changes how fast the models train, not how many are trained.
A regression model is trained to predict y = ln(price), where price is in US dollars. For one house the model outputs 11.0 and the true value of ln(price) is 11.2. What is the absolute error for this house in dollars?
- A. About 59,874 dollars
- B. About 1.22 dollars
- C. About 0.20 dollars
- D. About 13,256 dollars Correct answer
Option D is correct because the model works in log space, so dollar values come from exponentiating: e^11.2 is about 73,130 and e^11.0 is about 59,874, a difference of about 13,256 dollars. Option C is just the log-space error of 0.20, option B is a wrong conversion, and option A is the predicted price, not the error.
A fraud team has 1 percent positive transactions. Model A has precision 0.90 and recall 0.20 on the fraud class. Model B has precision 0.60 and recall 0.60. The team wants one metric that balances precision and recall. Which model scores higher on it, and why?
- A. Model B, with an F1 of 0.60 against about 0.33 for Model A Correct answer
- B. Model A, because F1 weights precision more than recall
- C. Model A, because its accuracy is higher on imbalanced data
- D. Model A, because its precision of 0.90 is the higher value
Option A is correct because F1 is the harmonic mean of precision and recall. Model B gives 0.60, while Model A gives 2 x 0.90 x 0.20 / (0.90 + 0.20), which is about 0.33. F1 weights precision and recall equally, accuracy is misleading with only 1 percent positives, and a high precision alone ignores that Model A misses most fraud.
A retailer lists five prediction tasks for its data science group. Which TWO tasks are regression problems?
- A. Estimating next month's revenue for each store Correct answer
- B. Grouping stores by their weekly sales pattern
- C. Forecasting the minutes a parcel needs to reach a customer Correct answer
- D. Deciding whether a card payment is fraudulent
- E. Assigning each support ticket to one of six queues
Options A and C are correct because they predict a continuous numeric value (revenue, minutes), which is regression. Option B groups stores without a label, so it is clustering. Options D and E assign a category (fraud or not, one of six queues), so they are classification.
Model Deployment
Which statement describes batch inference on Databricks?
- A. Predictions are returned to callers over a REST endpoint within milliseconds
- B. The model is reloaded and retrained each time a user opens a session
- C. Records are scored continuously as they arrive from a source such as Kafka
- D. A large set of records is scored on a schedule and the predictions are written to a table Correct answer
Option D is correct because batch inference scores a large set of records on a schedule, often as a job, and writes the predictions to a table. Millisecond responses over a REST endpoint describe real-time serving, continuous scoring of arriving Kafka records describes streaming inference, and retraining the model on every session is not inference at all.
A retailer serves version 3 of a registered model on one real-time Model Serving endpoint. It wants 90 percent of requests to stay on version 3 and 10 percent to go to version 4. What should it configure?
- A. A second endpoint, with the version 3 endpoint workload size set to 90 percent
- B. Both versions as served entities, with traffic_percentage 90 and 10 in the traffic config Correct answer
- C. Two endpoints, with a 90 and 10 weight set on the champion and challenger aliases
- D. Provisioned concurrency of 90 and 10 on the two versions' served entities
Option B is correct because a single Model Serving endpoint can host several served entities, and the traffic configuration assigns each a traffic_percentage, here 90 for version 3 and 10 for version 4. Workload size sets compute capacity, not traffic share, aliases carry no endpoint weights, and provisioned concurrency controls scaling, not request routing.
Which statement describes streaming inference on Databricks?
- A. A notebook loads the model once and predicts for a pandas DataFrame held in driver memory
- B. An application sends one row over HTTPS and waits for the prediction in the response
- C. A running query scores records as they arrive in a stream and appends predictions to a table Correct answer
- D. A scheduled job reads a stored table in full and writes one prediction per row to a results table
Option C is correct because streaming inference runs as a continuous query that scores records as they arrive and appends the predictions to a table. Option A describes single-node pandas inference, option B describes a real-time endpoint request, and option D describes batch inference over a stored table.
Through which interface does an application obtain a prediction from a Databricks Model Serving endpoint?
- A. A Structured Streaming source that reads the endpoint's output table
- B. A scheduled job that writes predictions to a file in cloud storage
- C. A REST API request sent to the endpoint over HTTPS Correct answer
- D. A JDBC query run against a SQL warehouse that holds the scores
Option C is correct because a Model Serving endpoint exposes a REST API, and the application sends an HTTPS request and receives the prediction in the response. The other options score data through tables, files or SQL, which is batch or streaming scoring and not how an endpoint is queried.
Which TWO workloads suit batch inference rather than a real-time endpoint?
- A. Flagging a sensor reading within seconds of it reaching the ingestion topic
- B. Ranking search suggestions after each keystroke in a mobile app
- C. Approving or declining a card payment while the cashier waits
- D. Scoring every subscriber overnight to refresh a retention-risk table Correct answer
- E. Producing next week's call list for the sales team from a stored table Correct answer
Options D and E are correct because both score stored data on a schedule with no one waiting for the answer, which is what batch inference is for. Options A, B and C each need a score within seconds or while a user waits, so they need streaming or a real-time endpoint.
Free Study Guide
Read the free Databricks Machine Learning Associate study guide: every exam topic explained in plain English, with diagrams, exam tips and the mistakes to avoid.
More Databricks Practice Exams
Practice with realistic mock exams to prepare for your Databricks certification.