Home / Databricks Certified Machine Learning Associate / Mock exam
Databricks Certified Machine Learning Associate Exam-style mock test

Databricks Machine Learning Associate Practice Exams|Practice test

Full explanations Exam format Pass line 70%
33 USD One-time · lifetime access
Enroll →

Sample questions

Example1 · Databricks ML Fundamentals & Workspace
A data scientist at a B2B SaaS company is iteratively building and testing a churn model in a Databricks notebook, running cells one at a time and inspecting intermediate DataFrames. Which compute resource is the most appropriate choice for this interactive development work?
✓An all-purpose (interactive) cluster that stays attached to the notebook and runs cells on demand
Correct. All-purpose clusters are designed for interactive, on-demand notebook execution where a user runs cells individually and explores data during development.
・A scheduled job cluster that spins up only when a triggered workflow starts and terminates immediately after
Incorrect. Job clusters are created for automated, non-interactive workflow runs and are torn down after the job, so they do not support iterative cell-by-cell development.
・A SQL warehouse endpoint configured for dashboard queries against the company's Delta tables
Incorrect. SQL warehouses serve BI and dashboard SQL queries, not interactive Python-based ML notebook development with intermediate DataFrame inspection.
・A serverless model serving endpoint hosting the deployed version of the churn model in production
Incorrect. Model serving endpoints host already-trained models for real-time inference and are not used for exploratory model building in notebooks.
Explanation
Interactive ML development in notebooks maps to all-purpose clusters, which remain attached and execute cells on demand.
Example2 · Data Preparation & Feature Engineering
A B2B SaaS company is preparing a churn training table where the 'monthly_active_seats' column has many missing values. The ML team wants to fill these gaps with the mean of the column as a reusable stage in a Spark ML Pipeline. Which approach should they use?
✓Add a pyspark.ml.feature.Imputer stage configured with inputCols and a strategy of mean so the fill value is learned during fit and applied at transform
Correct. The pyspark.ml.feature.Imputer is a pipeline stage that learns the mean (or median) at fit time and applies it at transform time, keeping the logic reusable and leak-free.
・Use DataFrame.fillna with a precomputed average value passed in as a constant literal before training
Incorrect. fillna with a precomputed constant works mechanically but is not a pipeline stage, so the value is not re-learned on new fit calls and is easy to misuse.
・Drop every row that contains a null in the seats column so the model only trains on complete records
Incorrect. Dropping rows discards potentially useful records and can bias the training set, and it is not an imputation strategy at all.
・Replace the nulls with zero using a withColumn expression that wraps the column in a coalesce call
Incorrect. Filling with zero via coalesce distorts the distribution because zero is a meaningful seat count, not a neutral placeholder for 'unknown'.
Explanation
Imputer is the idiomatic Spark ML stage for mean/median imputation and fits cleanly into a Pipeline so the learned fill value is applied consistently.
Example3 · Model Development (MLlib & scikit-learn)
A data scientist at a B2B SaaS company is preparing a churn dataset in a Spark DataFrame before fitting an MLlib model. They want a reproducible 80/20 train/test split that produces the same partitions on every run. Which approach correctly creates this split?
・Use df.sample(fraction=0.8) for the training set and then subtract that sample from the original DataFrame to obtain the remaining test rows
Incorrect. df.sample does not guarantee a complementary, non-overlapping partition and subtracting introduces extra shuffles without a clean reproducible split.
✓Call df.randomSplit([0.8, 0.2], seed=42) and unpack the returned list into separate train and test DataFrames
Correct. randomSplit with a fixed seed produces reproducible, non-overlapping train and test DataFrames according to the supplied weights.
・Apply df.limit() on the ordered DataFrame to take the first 80 percent of rows for training and the trailing rows for testing
Incorrect. Using limit on an ordered DataFrame produces a biased, non-random split that depends on row ordering rather than random assignment.
・Collect the DataFrame to the driver, shuffle the Python list with a fixed random state, and slice it into training and test portions
Incorrect. Collecting to the driver defeats distributed processing and will fail or be impractical for large datasets.
Explanation
randomSplit([0.8, 0.2], seed=...) is the idiomatic Spark way to create reproducible, mutually exclusive train/test DataFrames.
Example4 · MLflow Tracking & Model Lifecycle
A data scientist at a healthcare services firm is training a readmission-risk model inside a Databricks notebook and wants MLflow to capture the learning rate, the final AUC, and the trained model object in one run. Which combination of MLflow Tracking calls records all three correctly within an active run?
✓Use mlflow.log_param for the learning rate, mlflow.log_metric for the AUC, and mlflow.sklearn.log_model for the trained model
Correct. Hyperparameters like learning rate use log_param, evaluation results like AUC use log_metric, and flavor-specific log_model persists the fitted estimator with its environment.
・Use mlflow.log_metric for the learning rate, mlflow.log_param for the AUC, and mlflow.log_artifact for the trained model object directly
Incorrect. Learning rate is a parameter (log_param) not a metric, AUC is a metric (log_metric) not a parameter, and log_artifact alone does not package the model flavor correctly.
・Use mlflow.set_tag for the learning rate, mlflow.log_param for the AUC score, and then mlflow.register_model to persist the fitted estimator
Incorrect. set_tag is for descriptive labels, AUC is a metric not a parameter, and register_model promotes an already-logged model rather than persisting a fitted estimator from scratch.
・Use mlflow.log_param for both the learning rate and the AUC, then call mlflow.log_dict to serialize and store the trained model as JSON
Incorrect. AUC should be a metric, and log_dict stores small Python dictionaries as JSON artifacts, which cannot serialize a trained scikit-learn estimator properly.
Explanation
MLflow distinguishes parameters (inputs like learning rate), metrics (numeric results like AUC), and models (log_model with the proper flavor). Matching each value to the correct API is essential for reproducible tracking.
Example5 · Model Deployment, Scaling & AutoML
A healthcare services firm needs its triage-risk model to return a prediction the instant a nurse submits a patient's vitals through a web intake form. The clinical workflow cannot tolerate waiting for a scheduled job. Which Databricks deployment option best serves this requirement?
・Configure a nightly Databricks Workflow that scores the full patient roster and caches the results in a Delta table for the intake form to read
Incorrect. A nightly batch job produces stale, precomputed scores and cannot react to a brand-new submission in real time.
✓Serve the registered model behind a Databricks Model Serving endpoint that exposes a low-latency REST API for the intake form
Correct. Model Serving hosts the registered model as a scalable low-latency REST endpoint, delivering a prediction synchronously when the form is submitted.
・Export the model as a pickle file and have each clinician load it manually on their own laptop before entering vitals
Incorrect. Distributing pickle files to laptops is unmanaged, insecure, and provides no real-time serving infrastructure.
・Run a Spark structured streaming job that reprocesses the historical visits table every few minutes to refresh scores
Incorrect. Reprocessing the historical table on a micro-batch cadence still adds latency and does not score the individual new submission synchronously.
Explanation
Synchronous, per-request low-latency predictions are the use case for Databricks Model Serving endpoints, which expose the model as a REST API.
Example6 · Databricks ML Fundamentals & Workspace
A data scientist at a healthcare services firm is iteratively exploring patient readmission data in a notebook, running cells one at a time and inspecting intermediate DataFrames. She wants a cluster that stays available for her exploratory session and can be shared with a teammate reviewing the same notebook. Which cluster type best fits this interactive development workflow?
・A job cluster that is created automatically when a scheduled workflow starts and terminates as soon as that workflow run completes
Incorrect. Job clusters spin up for a specific scheduled run and terminate when it finishes, so they are unsuitable for an ongoing shared interactive exploration session.
✓An all-purpose cluster that remains running so multiple users can attach notebooks and run cells interactively during the session
Correct. All-purpose clusters stay running and let multiple users attach notebooks and execute cells interactively, which matches shared exploratory ML development.
・A SQL warehouse endpoint that is optimized exclusively for running BI dashboard queries against Delta tables
Incorrect. SQL warehouses serve SQL analytics and dashboards, not interactive Python notebook-based ML development with cell-by-cell DataFrame inspection.
・A single-node pool of spot instances reserved only for batch model scoring jobs that run overnight
Incorrect. A node pool reserved for overnight batch scoring targets scheduled inference, not interactive, shareable notebook exploration during the day.
Explanation
All-purpose clusters are designed for interactive, collaborative notebook development, whereas job clusters are ephemeral and tied to a single scheduled run.
Example7 · Databricks ML Fundamentals & Workspace
A data scientist at UrbanThread, an online apparel retailer, wants to interactively develop and test a scikit-learn churn model in a notebook, installing libraries like XGBoost and iterating on feature code throughout the day. Which cluster configuration should they choose to support this interactive ML development work?
・A job cluster that is created automatically when a scheduled workflow runs and terminated immediately after the task finishes each night
Incorrect. Job clusters spin up for a scheduled task and terminate on completion, which does not support all-day interactive development and iterative library installation in a notebook.
✓An all-purpose cluster running the Databricks Runtime for Machine Learning so preinstalled ML libraries are available during interactive notebook work
Correct. An all-purpose cluster with the Databricks Runtime for ML provides interactive notebook attachment plus preinstalled frameworks like scikit-learn, XGBoost, and MLflow for ongoing development.
・A SQL warehouse endpoint configured for high-concurrency dashboard queries against the retail sales gold tables
Incorrect. A SQL warehouse serves SQL analytics and BI dashboards; it cannot run Python notebooks or scikit-learn model training code interactively.
・A single-node cluster running the standard Databricks Runtime without any of the machine learning library packages installed
Incorrect. The standard runtime lacks the ML library stack, forcing manual installation of every framework and losing the convenience of the ML runtime.
Explanation
Interactive ML development benefits from an all-purpose cluster on the Databricks Runtime for ML, which bundles common machine learning libraries and keeps the environment attached for iteration.
Example8 · Databricks ML Fundamentals & Workspace
An ML engineer onboarding at UrbanThread is told to attach notebooks to clusters using the Databricks Runtime for Machine Learning instead of the standard runtime. What is the primary advantage of the ML runtime that justifies this guidance for the retailer's modeling work?
・It automatically converts all Spark DataFrames in a notebook into pandas DataFrames so models can be trained without any distributed computing
Incorrect. The ML runtime does not auto-convert Spark DataFrames to pandas; distributed data handling remains under the user's control.
✓It comes preinstalled with popular machine learning libraries and MLflow, reducing environment setup time for model development
Correct. The ML runtime bundles libraries such as scikit-learn, TensorFlow, XGBoost, and MLflow, so teams avoid installing and version-matching them manually.
・It guarantees that any trained model will be registered and transitioned to the Production stage in the model registry without manual steps
Incorrect. Model registration and stage transitions are deliberate MLflow actions, not automatic consequences of the runtime choice.
・It enforces that only SQL queries can be executed so that data scientists cannot accidentally run Python training code on shared resources
Incorrect. The ML runtime fully supports Python; it does not restrict execution to SQL only.
Explanation
The main value of the Databricks Runtime for ML is a preconfigured environment with common ML libraries and MLflow already installed, which accelerates development.
Example9 · Databricks ML Fundamentals & Workspace
A data scientist working on UrbanThread's recommendation notebook needs a specific version of the lightgbm package available only for their current notebook session, without affecting other users on the shared all-purpose cluster. Which approach should they use inside the notebook?
✓Run the %pip install lightgbm==<version> magic command at the top of the notebook to install it scoped to the current notebook session
Correct. The %pip install magic installs the library in the notebook-scoped environment, isolating it to that session without impacting others on the cluster.
・Open a terminal on the driver node and run a system-level package manager command so the package is installed globally for the whole cluster
Incorrect. A driver terminal system install changes the shared environment and is not the notebook-scoped, reproducible approach Databricks recommends.
・Edit the cluster's init script configuration in the admin console and restart the cluster so every attached notebook receives the package
Incorrect. An init script installs at cluster startup for every attached notebook, which is cluster-wide and not isolated to one session.
・Add the package as a cluster-scoped library through the cluster UI libraries tab so it installs for all notebooks on that cluster
Incorrect. Cluster-scoped libraries apply to all notebooks on the cluster, so they would affect other users rather than isolating the install.
Explanation
Notebook-scoped library installs via %pip affect only the current notebook session, which is the recommended way to isolate dependencies on a shared cluster.
Example10 · Databricks ML Fundamentals & Workspace
A machine learning engineer at a retail bank wants to keep exploratory credit-scoring notebooks organized so teammates can collaborate on the same code. Where in the Databricks workspace should these shared notebooks be stored for team access and version control integration?
・In the DBFS root directory under /FileStore so every cluster can mount and open the files directly
Incorrect. DBFS /FileStore holds data files and static assets, not collaborative source-controlled notebooks, and it offers no version control.
✓In a Repos (Git folder) connected to the bank's remote repository so changes are tracked and shared
Correct. Databricks Repos (Git folders) store notebooks under Git version control, enabling teammates to collaborate and track changes against a remote repository.
・In the cluster's local driver storage, which automatically persists and syncs across the whole team
Incorrect. Driver local storage is ephemeral and tied to a single cluster, so it neither persists reliably nor syncs across a team.
・In the MLflow experiment tracking UI, which is the canonical location for all project notebooks
Incorrect. The MLflow experiment UI tracks runs, parameters, and metrics; it is not a storage location or editor for shared notebooks.
Explanation
Databricks Repos integrate with Git providers to give teams version-controlled, collaborative notebook storage, which is the recommended way to share ML code.
Example11 · Databricks ML Fundamentals & Workspace
A data scientist at an insurance firm is interactively prototyping a fraud-detection model and wants a cluster that supports library installs for iterative notebook work while being manually started and stopped as needed. Which cluster configuration best fits this interactive development workload?
・A job compute cluster that spins up only when a scheduled task runs and then terminates immediately afterward
Incorrect. Job compute is optimized for automated scheduled tasks and terminates after the job, which does not suit interactive prototyping.
・A single-node serverless SQL warehouse configured specifically for running BI dashboard queries at scale
Incorrect. A SQL warehouse serves SQL/BI query workloads, not Python notebook ML development with library installs.
✓An all-purpose (interactive) cluster that the data scientist starts, attaches to the notebook, and stops manually
Correct. An all-purpose (interactive) cluster is designed for interactive notebook development, supports library installs, and can be started and stopped manually.
・A pool of spot instances with no attached runtime, reserved strictly for batch ETL ingestion pipelines
Incorrect. A bare instance pool without a runtime cannot run notebooks and is intended to speed up cluster provisioning, not interactive ML work.
Explanation
All-purpose clusters are built for interactive, iterative development where users attach notebooks, install libraries, and control cluster lifecycle manually.
Example12 · Databricks ML Fundamentals & Workspace
A data scientist at a industrial parts distributor is iteratively exploring sales-forecasting features in a notebook, running cells repeatedly and adjusting code throughout the day. Which cluster configuration is most appropriate for this interactive exploratory work?
・A job cluster that is automatically created when a scheduled workflow starts and terminated the moment that workflow run finishes each night
Incorrect. Job clusters are provisioned per scheduled run and terminate when the job ends, so they are designed for automated production workloads rather than all-day interactive notebook development.
✓An all-purpose cluster with the Databricks Runtime for ML, which the scientist can attach the notebook to and keep running during the session
Correct. All-purpose clusters are built for interactive, collaborative notebook work, and choosing the Databricks Runtime for ML pre-installs the common ML libraries the scientist needs while exploring features.
・A SQL warehouse configured for serverless compute so that dashboards and BI queries against the gold tables return quickly
Incorrect. SQL warehouses execute SQL for BI and dashboarding; they do not attach to Python/ML notebooks for iterative model-development work.
・A single-node cluster using the standard (non-ML) Databricks Runtime with no autoscaling and libraries installed one by one
Incorrect. A standard runtime lacks the bundled ML libraries, forcing manual installs, so it is a poorer fit than the ML runtime for exploratory model development.
Explanation
Interactive, iterative notebook development calls for an all-purpose cluster, and the Databricks Runtime for ML pre-packages the libraries data scientists rely on.
Example13 · Databricks ML Fundamentals & Workspace
A new team member at the distributor asks why the lead chooses the Databricks Runtime for ML instead of the standard runtime when building demand-prediction models. What is the primary benefit the lead should cite?
・It automatically converts all Spark DataFrame operations into pandas operations so that single-node libraries can scale across the entire cluster without code changes
Incorrect. The ML runtime does not transparently convert Spark operations into pandas; pandas API on Spark exists but is an opt-in API, not an automatic conversion of all operations.
・It guarantees that every model trained on the cluster is automatically registered, versioned, and promoted to production in the model registry
Incorrect. Registration, versioning, and promotion are explicit actions performed through MLflow and the model registry, not automatic consequences of using the ML runtime.
✓It comes preinstalled with popular machine learning libraries such as scikit-learn, XGBoost, and TensorFlow, reducing environment setup
Correct. The Databricks Runtime for ML bundles common ML libraries like scikit-learn, XGBoost, and TensorFlow, which saves data scientists from manually configuring their environment.
・It provides a managed SQL endpoint that lets analysts query feature tables with low latency directly from BI tools
Incorrect. Managed low-latency SQL endpoints for BI tools are provided by SQL warehouses, not by the ML runtime attached to a compute cluster.
Explanation
The headline benefit of the ML runtime is the preinstalled set of ML libraries that removes repetitive environment setup.
Example14 · Databricks ML Fundamentals & Workspace
A data scientist at a telecom operator is iteratively building a churn model in a notebook, running cells repeatedly while exploring call-detail-record features. She needs a cluster she can attach her notebook to directly and keep alive across interactive sessions. Which cluster type should she provision?
・A job cluster that the workspace scheduler creates automatically when a scheduled task starts and terminates once that task finishes running
Incorrect. Job clusters are created for a specific scheduled job run and terminate when the task completes, so they are not meant for ongoing interactive notebook development.
✓An all-purpose cluster that she can attach notebooks to and reuse for interactive exploration across sessions
Correct. All-purpose clusters are designed for interactive analysis; a data scientist can attach notebooks, rerun cells, and keep the cluster alive across an exploration session.
・A SQL warehouse endpoint dedicated to running dashboard queries against the operator's curated serving tables
Incorrect. SQL warehouses serve SQL analytics and dashboards, not notebook-driven Python ML development with attached notebooks.
・A single-node pool of idle instances reserved only for serving real-time inference traffic to downstream apps
Incorrect. Instance pools pre-warm VMs to speed cluster startup but are not themselves an interactive compute target you attach notebooks to for exploration.
Explanation
Interactive, session-persistent notebook development on Databricks runs on all-purpose clusters, whereas job clusters are ephemeral and SQL warehouses target analytics.
Example15 · Databricks ML Fundamentals & Workspace
A telecom analytics team wants to spin up a cluster where scikit-learn, XGBoost, and MLflow are already installed without manually running pip for each library. Which runtime choice best meets this requirement?
・The standard Databricks Runtime, then manually installing scikit-learn, XGBoost, and MLflow as cluster libraries after the cluster starts
Incorrect. The standard runtime does not bundle ML libraries, so the team would have to install each package manually, which is exactly what they want to avoid.
✓Databricks Runtime for Machine Learning, which ships with popular ML libraries such as scikit-learn, XGBoost, and MLflow preinstalled
Correct. Databricks Runtime for Machine Learning comes with common ML libraries like scikit-learn, XGBoost, and MLflow already installed, removing manual setup.
・Databricks Runtime for Genomics, which is tuned for DNA sequencing pipelines and bioinformatics workloads at scale
Incorrect. The Genomics runtime targets bioinformatics workloads and is not the general-purpose ML runtime with scikit-learn and XGBoost preinstalled.
・A photon-enabled SQL runtime optimized for vectorized execution of large analytical SQL queries on serving tables
Incorrect. A Photon SQL runtime accelerates analytical SQL execution but does not provide a preconfigured Python ML library stack.
Explanation
Databricks Runtime for Machine Learning is purpose-built with ML libraries preinstalled, saving manual environment setup compared with the standard runtime.
▶ Try 10 free questions (graded)
Measure your readiness with a full mock exam
All questions · full explanations · lifetime access
Enroll(33 USD)