Courseiva

Databricks Certified Machine Learning Associate (Databricks-ML-Assoc) — Questions 226–300

319 questions total · 5 pages · All types, answers revealed

Page 3

Page 4 of 5

Page 5
226
MCQmedium

A machine learning engineer is building a scikit-learn model with hyperparameter tuning on Databricks. They want each trial to be tracked as a nested run under a single parent run in MLflow so that all trials are grouped together and the best parameters can be compared easily. Which MLflow API call should they use to start each trial run so that it is nested under the currently active run?

A.mlflow.set_tag("mlflow.parentRunId", parent_id)
B.mlflow.start_run(nested=True)
C.mlflow.log_artifact()
D.mlflow.create_experiment()
AnswerB

Using start_run with nested=True creates a child run under the active parent run, keeping trial metrics and parameters grouped. This is the standard MLflow pattern for hyperparameter tuning, where the parent run represents the overall tuning job and each trial is a nested run that can be compared and selected. The child run inherits the parent's experiment and tags, and the UI displays the hierarchy clearly.

Why this answer

Nested runs are created by calling mlflow.start_run with nested=True while a parent run is active. This groups all trial runs under one parent, making it easy to compare metrics and select the best hyperparameters. Other MLflow APIs either create separate experiments or log artifacts, and manually setting parentRunId is not the supported nesting mechanism.

Exam trap

The trap here is confusing experiment creation or manual tagging with nested run creation, when MLflow provides a dedicated nested parameter on start_run.

227
MCQmedium

When logging a model in Databricks, why is it recommended to specify the `pip_requirements` or `conda_env` explicitly instead of relying on the environment's current state?

A.It forces the model to use the latest version of all libraries.
B.It ensures the model remains portable and reproducible.
C.It significantly reduces the model artifact's memory usage.
D.It allows the model to run without any Python libraries.
AnswerB

Explicitly defined dependencies create a portable model artifact that carries its own environment specification. This ensures that regardless of where the model is deployed—whether on a different Databricks cluster or a separate containerized environment—it will always have the exact libraries required to execute predictions correctly.

Why this answer

Relying on the current notebook environment is risky because it captures all installed packages, not just those required for the model. Specifying dependencies explicitly ensures that the environment is minimal and reproducible, which is vital for preventing environment conflicts in production. This practice ensures that the model can be deployed successfully in clean, isolated environments, a core requirement for stable production model serving and CI/CD pipelines.

Exam trap

Candidates often assume that the current notebook environment is sufficient for deployment, failing to account for 'dependency bloat' where unnecessary packages cause conflicts in production.

228
MCQmedium

A machine learning engineer is deploying an MLflow model to a Databricks Model Serving endpoint. The model was trained on a Spark DataFrame and logged with MLflow using the default signature detection. During testing, the endpoint returns predictions, but the engineer notices the input schema shown in the Serving UI does not match the actual DataFrame column types used during training. Which MLflow logging step should the engineer verify first to resolve this schema mismatch?

A.The model's conda environment file lists incompatible library versions, so the Serving endpoint silently coerces input types to match the environment.
B.The model was logged with `mlflow.pyfunc.log_model` without explicitly passing the `signature` argument, so MLflow inferred it from a sample that may not represent the full schema.
C.The Serving endpoint was configured with `min_instances` greater than zero, which forces the endpoint to rewrite the schema for autoscaling compatibility.
D.The model was registered in the Model Registry under a different name than the one used in the Serving endpoint configuration, causing the endpoint to load a stale schema.
AnswerB

When a model is logged without an explicit signature, MLflow attempts to infer it from the input example or from the model's internal schema, which can be incomplete or incorrect. The Serving endpoint relies on that logged signature to validate and parse incoming requests, so the engineer should check whether the signature was explicitly provided and correct. Supplying a proper `ModelSignature` during logging ensures the endpoint enforces the expected column names and types.

Why this answer

The logged MLflow model signature is the authoritative contract for the Serving endpoint's expected input columns and types. When a signature is missing or inferred from an unrepresentative sample, the endpoint may expose an incorrect schema. Explicitly passing a `ModelSignature` during `log_model` ensures column names and data types align with training data, resolving the mismatch before redeployment.

Exam trap

The trap here is assuming that any logged MLflow model automatically carries a complete and correct signature, when in fact inference can be incomplete.

229
MCQmedium

A data scientist is using MLflow to train a scikit-learn model on Databricks. They call mlflow.sklearn.autolog() before fitting the model. After the run completes, they need to retrieve the automatically logged model and load it for batch inference in a separate notebook. Which approach correctly retrieves the logged model for loading?

A.Access the model directly from the DBFS path '/dbfs/FileStore/models/<run_id>' and load it using joblib.load().
B.Read the model from the Delta table that MLflow automatically creates in the default database when autologging is enabled.
C.Use the MLflow run ID to construct the artifact URI 'runs:/<run_id>/model' and pass it to mlflow.sklearn.load_model().
D.Query the MLflow tracking server's REST API endpoint '/api/2.0/mlflow/runs/get' and extract the model binary from the response.
AnswerC

mlflow.sklearn.autolog() logs the trained model to the run's artifact path under 'model'. The run ID uniquely identifies the run, and the artifact URI 'runs:/<run_id>/model' is the standard way to reference that logged model. Passing it to mlflow.sklearn.load_model() correctly loads the model for inference.

Why this answer

With MLflow autologging, the trained model is saved as an artifact in the run's artifact directory under the name 'model'. To load it later, you need the run ID and the artifact path. The 'runs:/' URI scheme provides a portable reference to the run's artifacts, and mlflow.sklearn.load_model() correctly interprets that URI to reconstruct the model.

Exam trap

The trap here is assuming that autologging stores models in a fixed DBFS location or a Delta table, when it actually logs them as artifacts tied to the run ID.

230
MCQmedium

A data scientist is preparing a feature table in Databricks Feature Store. To ensure the feature table can be used for online inference with low latency, which step is mandatory?

A.Register the feature table in the Unity Catalog without any additional configuration.
B.Call the write_batch method to export features to an S3 bucket for the model to read at runtime.
C.Use the publish_table method to sync features to an online store configured in the Feature Store.
D.Include the feature table in a Databricks Job that runs every minute to keep the data fresh.
AnswerC

The publish_table method is the dedicated API function in Databricks Feature Store designed to replicate feature data from the offline store to an online store. This ensures the features are available for fast key-value lookups, fulfilling the latency requirements necessary for real-time model scoring requests.

Why this answer

To enable online serving, the feature table must be published to a supported online store like Amazon DynamoDB, Azure Cosmos DB, or Google Cloud Bigtable. This process decouples the feature retrieval from the complex logic of feature engineering pipelines, allowing real-time models to fetch pre-computed features in milliseconds rather than recalculating them during the inference request, which is critical for high-throughput production ML applications.

Exam trap

Students often assume registering a model in the Workspace automatically provisions online feature retrieval, missing the explicit sync requirement to an online store.

231
MCQeasy

A data engineer is working with a large Delta table and wants to optimize it for machine learning feature engineering. They frequently filter data by a column named 'event_date' and join on a column named 'user_id'. Which Delta Lake feature should they use to improve query performance?

A.Enabling change data feed (CDF).
B.Using OPTIMIZE with file compaction.
C.Partitioning by 'user_id'.
D.Z-ORDER BY on 'user_id' and 'event_date'.
AnswerD

Z-ORDER BY co-locates related data in the same set of files, improving data skipping for queries that filter on the specified columns. By clustering on 'user_id' and 'event_date', queries that filter by 'event_date' and join on 'user_id' can skip irrelevant files, reducing I/O and speeding up feature engineering. This is the recommended optimization for such access patterns.

Why this answer

Z-ORDER BY clusters data on the specified columns, enabling efficient data skipping for filters and joins. Since the engineer filters by 'event_date' and joins on 'user_id', Z-ORDER on both columns will significantly improve performance. Partitioning on high-cardinality 'user_id' is inefficient, and CDF or simple compaction do not address the need for co-locating related data.

Exam trap

The trap here is assuming that partitioning always improves performance, but for high-cardinality columns it can create too many small files and worsen performance.

232
MCQhard

Refer to the exhibit. A model was successfully logged but fails to load in a production environment with the error shown in the exhibit. What is the most likely cause of this issue?

A.The model artifact is corrupted during the transfer to the production environment.
B.The production environment has a different version of scikit-learn than the training environment.
C.The model was trained using an incompatible version of the Spark runtime.
D.The model requires an external network connection to download the sklearn library during loading.
AnswerB

Module errors in Python usually arise when the code attempts to import a module that does not exist in the current version of the library. If the training environment had a newer scikit-learn version and the production environment is running an older one, sub-modules may not be present.

Why this answer

The error indicates a missing dependency or version mismatch in the inference environment. When a model relies on specific sub-modules, these must be available in the underlying Python environment. This issue highlights the importance of correctly specifying dependencies during the logging phase.

If the environment is not captured precisely, the inference cluster will fail to load the model because the necessary shared libraries are missing or incompatible.

Exam trap

Candidates often blame the model code itself, missing the most common cause: environment drift where the production library versions differ from the training environment.

233
Multi-Selecthard

A team owns a Databricks Model Serving endpoint that receives sporadic bursts of traffic. They want to reduce cold-start latency during bursts while keeping cost predictable, and they also need to capture the request payloads and predictions for later monitoring. Which two configuration choices should they make? (Choose two.)

Select 2 answers
A.Set scale_to_zero_enabled to true on the served entity to lower idle cost.
B.Increase the endpoint's workload size from Small to Large.
C.Set min_instances to a value greater than zero so a warm replica is always available.
D.Attach an MLflow experiment to the endpoint to record prediction requests.
E.Enable inference tables on the endpoint so requests and responses are logged to a Delta table.
AnswersC, E

Setting min_instances above zero keeps at least that many replicas provisioned and ready, so requests arriving after an idle period do not wait for a new container to load the model. This directly addresses cold-start latency during bursts, at the cost of paying for the always-on capacity. It does not by itself record request payloads or predictions.

Why this answer

Cold-start latency during sporadic bursts is best mitigated by keeping at least one replica warm with min_instances greater than zero, avoiding scale-to-zero teardown. Capturing request payloads and predictions for monitoring is done with inference tables, which write each request and response to a Delta table. Together these meet both the latency and the observability goals without conflicting.

Exam trap

The trap here is treating scale_to_zero_enabled, which saves cost by idling replicas, as a latency optimization, when it is actually the primary cause of cold starts on a serving endpoint.

234
MCQhard

A machine learning engineer is using MLflow to track experiments. They call mlflow.start_run() and then log a model with mlflow.sklearn.log_model(). After the run completes, they notice that the model artifact is stored in the run's artifact location, but the run's source version and git commit are not captured. They are running from a Databricks notebook with Git integration enabled. Which action will ensure that the Git commit hash and source version are automatically logged to the MLflow run?

A.Set the environment variable MLFLOW_GIT_COMMIT to the current commit hash before starting the run.
B.Ensure that the notebook is attached to a Git repository and that the Git integration is properly configured so MLflow can detect the commit hash.
C.Call mlflow.set_tag('mlflow.source.git.commit', commit_hash) after starting the run.
D.Use mlflow.log_artifact() to upload the .git directory to the run's artifacts.
AnswerB

MLflow automatically captures the Git commit hash and source version when the code is executed from within a Git repository. In Databricks, if the notebook is part of a Git folder and the Git integration is enabled, MLflow will detect the repository and log the commit hash and source version to the run. This is the intended mechanism.

Why this answer

MLflow automatically logs Git metadata when the code runs from a Git repository. In Databricks, if the notebook is in a Git folder with integration enabled, MLflow detects the repository and records the commit hash and source version in the run. This is the standard behavior; manual environment variables or tags are unnecessary and not the automatic mechanism.

Exam trap

The trap here is thinking that manual tagging or environment variables are required, when MLflow's Git integration automatically captures the commit hash when a Git repository is detected.

235
MCQmedium

A data scientist is training a model using MLflow on Databricks. They need to ensure that the model artifacts and metrics are logged automatically without adding manual logging code to the training script. Which approach should they use?

A.Call mlflow.set_tracking_uri() inside the training function to redirect logs to the workspace.
B.Wrap the training logic within an mlflow.start_run() block without any additional configuration.
C.Execute mlflow.autolog() at the start of the notebook cell before running the model training code.
D.Configure the Databricks cluster environment variable MLFLOW_TRACKING_ENABLED to true.
AnswerC

Calling mlflow.autolog() enables the library-specific hooks that automatically record metrics, parameters, and artifacts during the execution of supported model training methods. This is the standard practice for Databricks ML workflows to reduce manual instrumentation overhead while ensuring that every model iteration is fully documented and tracked automatically.

Why this answer

MLflow provides autologging capabilities that automatically capture parameters, metrics, and models when using popular machine learning libraries like Scikit-learn, TensorFlow, or PyTorch. By calling mlflow.autolog() before the training code, the framework instruments the library calls to record telemetry automatically. This approach minimizes boilerplate code and ensures consistency across experiments, which is essential for auditability and model reproducibility in collaborative Databricks environments, as it prevents human error in manual logging.

Exam trap

Students mistakenly think autologging happens automatically without code invocation, forgetting they must explicitly call 'mlflow.autolog()' within the notebook.

236
MCQhard

A machine learning engineer is using Databricks Feature Store to create a training dataset. They want to ensure that the features used during training are exactly the same as those served at inference time. Which Feature Store capability should they rely on?

A.Point-in-time lookups when creating the training set
B.Feature freshness monitoring
C.Automatic feature scaling during training
D.Online store for low-latency feature retrieval
AnswerA

Point-in-time lookups ensure that the training dataset is constructed using feature values as they existed at the time of each label event, preventing data leakage. This mirrors the feature values that would be available at inference time, ensuring consistency between training and serving. It is a core capability of Databricks Feature Store for time-series correctness.

Why this answer

Databricks Feature Store provides point-in-time lookups to create training datasets that reflect the state of features at the time of each label. This prevents leakage and ensures that the same feature values would be available at inference. Other options are either not Feature Store capabilities or do not address training-serving skew.

Exam trap

The trap here is thinking that the online store alone guarantees consistency, but training-serving consistency also requires point-in-time correctness during training set creation.

237
MCQmedium

A data scientist is using MLflow to track experiments. They notice that all runs from a particular notebook are being logged to the default experiment instead of the experiment they intended to use. They have already called mlflow.start_run() without specifying an experiment ID. What is the most likely cause?

A.The MLflow tracking server is misconfigured, causing runs to be redirected to the default experiment.
B.The MLflow client library version is outdated and does not support custom experiments.
C.The active MLflow experiment was not set using mlflow.set_experiment before starting the run.
D.The run was started with nested=True, which forces logging to the default experiment.
AnswerC

MLflow uses the active experiment to determine where runs are logged. If mlflow.set_experiment is not called, MLflow defaults to the experiment with ID 0, often named 'Default'. The start_run function does not automatically associate runs with a specific experiment unless the experiment is set beforehand or specified via the experiment_id argument.

Why this answer

MLflow logs runs to the active experiment, which is set via mlflow.set_experiment. If not set, runs go to the default experiment (ID 0). The start_run function does not automatically infer the intended experiment from the notebook context.

To fix this, the data scientist should call mlflow.set_experiment with the desired experiment name or pass experiment_id to start_run.

Exam trap

The trap here is assuming that start_run automatically uses the experiment associated with the notebook or script; it requires explicit setting.

238
MCQeasy

A data scientist is comparing multiple hyperparameter configurations for a model and wants to view the resulting metrics side by side in a single interface, sort runs by accuracy, and drill into individual run details. Which MLflow component provides this capability?

A.MLflow Tracking UI, which lists runs within an experiment and supports sorting and filtering by metrics.
B.MLflow Model Registry UI, which shows model versions and their stage transitions.
C.MLflow Projects dashboard, which lists available projects and their entry points.
D.Databricks Jobs run history, which shows task durations and statuses for scheduled workflows.
AnswerA

The MLflow Tracking UI is the built-in interface for viewing runs in an experiment. It displays metrics, parameters, and tags in a sortable table, allows filtering, and lets users click into a run to see artifacts and details. This directly supports comparing hyperparameter configurations side by side and sorting by accuracy.

Why this answer

The MLflow Tracking UI is designed for experiment comparison. It presents runs in a sortable table with metrics and parameters, supports filtering, and allows drilling into individual runs. The Model Registry UI, Projects, and Jobs run history serve different purposes and do not offer the same run comparison and metric sorting features.

Exam trap

The trap here is assuming the Model Registry UI or Jobs run history can compare experiment runs, when only the MLflow Tracking UI provides that side-by-side metric view.

239
MCQmedium

Refer to the exhibit. A data scientist is attempting to deploy a model using the MLflow client. The error above occurs during the deployment script. What is the most likely cause of this failure?

A.The cluster does not have the necessary MLflow libraries installed.
B.The model has not been registered in the Model Registry with the specified name and version.
C.The user lacks permissions to read the model version from the Registry.
D.The model version is still in the 'Archived' state and cannot be accessed.
AnswerB

The RestException explicitly confirms that the registry lookup failed for the provided name and version. This indicates a mismatch between the deployment configuration and the actual state of the registry. The user must verify the registration status via the UI or list_model_versions to confirm existence.

Why this answer

This error indicates that the specified model version does not exist in the Registry, either because it was never registered, was deleted, or the name/version number was referenced incorrectly. In a Databricks context, verify that the model has been successfully logged and registered using mlflow.register_model. This is critical for deployment pipelines as it validates that the artifact exists before the serving infrastructure attempts to load the model file.

Exam trap

Candidates often assume that simply training a model makes it available for serving. They overlook the mandatory step of explicitly registering the model in the MLflow Model Registry first.

240
MCQhard

Refer to the exhibit. A user attempts to update a model stage in the Model Registry and receives this error. What is the most appropriate action to resolve this?

A.Re-register the model under a new name
B.Request the workspace admin to update the model ACLs
C.Upgrade the model to a higher version
D.Switch to a different Databricks cluster
AnswerB

The correct administrative path is to update the Access Control List (ACL) for the specific model object. A workspace administrator or the current owner has the authority to grant the required 'CAN_MANAGE' permission to the user, allowing them to perform the requested stage transition securely and officially.

Why this answer

The error clearly indicates a lack of permission to modify the model's state. In Databricks, access control lists (ACLs) are strictly enforced on objects in the registry. To perform administrative actions like changing a model's stage, the user must be assigned the appropriate permission level (CAN_MANAGE) by an owner or admin.

This enforces the principle of least privilege, preventing unauthorized users from promoting unvetted models to production.

Exam trap

Candidates often try to modify model code or rewrite endpoint configurations to fix permission errors, failing to recognize that access control lists (ACLs) restrict registry actions.

241
MCQhard

A machine learning engineer is using MLflow to track experiments. They want to compare multiple runs and identify the run that produced the best model based on a custom metric called 'weighted_f1'. They have logged this metric using mlflow.log_metric. Which MLflow UI feature allows them to sort and filter runs by this metric to quickly find the best run?

A.The experiment notes field where you can manually record the best run ID.
B.The runs table with column sorting and the filter box using metric.weighted_f1.
C.The model registry's stage transitions, which automatically promote the run with the highest metric.
D.The artifact viewer, which displays metric plots and allows sorting by value.
AnswerB

The MLflow UI runs table allows sorting by any logged metric column and filtering using syntax like metrics.weighted_f1 > 0.8. This enables quick identification of the best run. The metric must be logged as a numeric value for sorting and filtering to work.

Why this answer

The MLflow UI runs table provides a sortable and filterable view of all runs in an experiment. By sorting on the 'weighted_f1' metric column or using a filter expression, the engineer can instantly locate the top-performing run. This is the standard way to compare runs and select the best model.

Exam trap

The trap here is confusing manual documentation features like notes with automated comparison tools in the MLflow UI.

242
MCQmedium

A data scientist is training a deep learning model on Databricks using Horovod for distributed training. They find that the model is converging slowly. What is the most likely cause related to the distributed configuration?

A.The cluster has too much memory per worker.
B.The learning rate was not adjusted for the distributed batch size.
C.The storage throughput of the DBFS mount is too high.
D.The number of epochs is too low for the current model size.
AnswerB

Distributed training increases the effective batch size by multiplying the per-worker batch size by the number of workers. If the learning rate is not adjusted to account for this increase, the model will likely exhibit unstable or slow convergence. This is a fundamental concept in large-scale distributed deep learning optimization.

Why this answer

In Horovod distributed training, the learning rate must often be scaled relative to the number of workers, because each worker processes a batch of data. A common mistake is failing to adjust the learning rate or optimizer settings to compensate for the aggregate batch size across the cluster. This results in ineffective gradient updates, slowing down convergence significantly compared to a single-node setup.

Exam trap

Candidates often assume that distributed training automatically scales the learning rate. They fail to realize that increasing the global batch size requires a corresponding increase in the learning rate to maintain stable convergence.

243
MCQhard

A data scientist registered a model in Unity Catalog and now wants to serve it as a low-latency REST endpoint for an application. They need automatic scaling, a secure endpoint URL, and the ability to update the served model version without redeploying infrastructure. Which Databricks capability should they use?

A.A SQL warehouse with a user-defined function wrapping the model.
B.An all-purpose cluster running an MLflow model server manually.
C.Model Serving with a served entity pointing at the registered model version.
D.A Databricks job that runs a notebook on a schedule to score requests.
AnswerC

Databricks Model Serving creates managed REST endpoints that automatically scale, provide a secure URL, and can be configured with a served entity that references a Unity Catalog model and version. Updating the served version changes what the endpoint serves without rebuilding infrastructure, which matches the requirements for low latency, security, and version flexibility in this scenario.

Why this answer

Model Serving provides managed, autoscaling REST endpoints backed by registered model versions. Configuring a served entity that references a Unity Catalog model and version gives a secure URL and lets the team change the served version without rebuilding the endpoint, satisfying low-latency, secure, and updatable serving needs in one capability.

Exam trap

The trap here is treating scheduled batch jobs or SQL warehouses as substitutes for a managed low-latency serving endpoint.

244
MCQmedium

A data scientist is using Spark MLlib and wants to perform feature scaling on a large dataset. Which transformer should they use within a Pipeline to ensure that the scaling logic is correctly applied during both training and inference?

A.Manually calculate the mean and divide the DataFrame columns.
B.StandardScaler from pyspark.ml.feature.
C.Pandas transformation functions via a UDF.
D.The VectorAssembler utility to normalize the input vector.
AnswerB

StandardScaler is a Spark transformer that integrates into ML Pipelines. It fits to the training data to calculate statistics and transforms the data accordingly. Once the Pipeline is saved, these statistics are persisted with the model, guaranteeing that consistent scaling is applied automatically whenever the model is used for inference.

Why this answer

Using a Pipeline with a scaler like StandardScaler or MinMaxScaler ensures that the scaling parameters (like mean and standard deviation) are captured as part of the model object. This is critical because the exact same scaling must be applied to new, unseen data during inference. Without this, the model will receive improperly scaled inputs, leading to incorrect predictions, as the model expects data to follow the same distribution used during training.

Exam trap

Many candidates apply scaling transformations directly to the DataFrame using standard Spark functions before splitting, causing data leakage and deployment failures.

245
MCQhard

A team has several model versions registered in Unity Catalog. They want to serve a specific version through a Databricks Model Serving endpoint and later promote a newer version without changing the endpoint URL used by applications. Which approach should they use?

A.Create the endpoint pointing to a fixed model version, then delete and recreate the endpoint with the new version when promoting.
B.Create the endpoint pointing to a Unity Catalog alias such as 'champion', and update the alias to reference the new model version when promoting.
C.Create the endpoint pointing to the model name without a version, and rely on the platform to always serve the most recently created version.
D.Create one endpoint per model version and place a load balancer in front that routes to the newest endpoint.
AnswerB

Serving endpoints can target a model alias rather than a fixed version. Pointing the endpoint at an alias like 'champion' lets the team repoint the alias to a new version, and the endpoint picks up the change without altering the URL. This decouples consumers from version numbers and supports controlled promotion.

Why this answer

Databricks Model Serving endpoints can reference a Unity Catalog model alias instead of a fixed version. Applications call a stable endpoint URL, and the team promotes new versions by moving the alias, such as from 'champion' to a newer version. This preserves the URL, avoids endpoint recreation, and keeps promotion governed through alias updates rather than client-side changes.

Exam trap

The trap here is assuming the endpoint must be rebuilt for each new version, when a Unity Catalog alias lets the same endpoint follow promotions.

246
MCQmedium

An ML engineer trains a scikit-learn model on a Spark DataFrame in a Databricks notebook using MLflow autologging. The run logs parameters and metrics, but the engineer later opens the MLflow run and cannot find any input dataset lineage. Which action should the engineer take to ensure the training dataset is recorded with the run in the MLflow UI?

A.Set the MLFLOW_TRACKING_URI environment variable to the Unity Catalog metastore and rerun training.
B.Call mlflow.log_artifact() on the Spark DataFrame object directly after training.
C.Enable Delta table time travel on the source table and reference the table path in the run tags.
D.Wrap the training data with mlflow.data.from_spark() and pass it to mlflow.log_input().
AnswerD

mlflow.data.from_spark() constructs a Dataset object from a Spark DataFrame, and mlflow.log_input() records it on the active run, which is exactly what populates the Datasets section of the MLflow run UI. This is the supported mechanism for capturing input data lineage in MLflow on Databricks, and it works alongside autologging rather than replacing it.

Why this answer

MLflow records input dataset lineage only when a Dataset object is created and logged to the active run. The mlflow.data.from_spark() constructor builds that object from a Spark DataFrame, and mlflow.log_input() attaches it, after which the run UI shows dataset source, digest, and schema. Autologging captures params, metrics, and the model, but not input data lineage, so an explicit call is required.

Exam trap

The trap here is assuming MLflow autologging automatically captures input dataset lineage, when in fact dataset tracking must be added explicitly with mlflow.log_input().

247
MCQmedium

When a data scientist needs to share an MLflow experiment with a team member, what is the best practice for ensuring collaborative access within Databricks?

A.Exporting the experiment to a CSV file and emailing it.
B.Granting appropriate permissions on the experiment within the MLflow UI.
C.Moving the experiment to a public folder in DBFS.
D.Giving everyone admin access to the workspace.
AnswerB

Granting permissions within the Databricks UI ensures secure and efficient collaboration. This allows team members to view or manage the experiment directly, maintaining data governance and auditability. It is the recommended practice for teams, as it centralizes access management and ensures that experiment results remain securely contained within the workspace.

Why this answer

Sharing experiments is done by managing permissions on the experiment object itself. In Databricks, you can grant specific permissions (e.g., CAN_VIEW, CAN_MANAGE) to individual users or groups. This allows for controlled collaboration where team members can see experiment results without necessarily having the ability to modify or delete them, adhering to the principle of least privilege while fostering efficient teamwork during the development process.

Exam trap

Candidates often assume that sharing a notebook automatically grants access to the associated experiments. They fail to realize that experiment permissions are managed separately within the MLflow UI.

248
MCQhard

Refer to the exhibit. A data scientist is attempting to log a model to an S3 bucket via MLflow, but they receive the error shown. What is the most likely root cause?

A.The S3 bucket is full and cannot accept new model artifacts.
B.The MLflow model flavor is not compatible with the S3 storage protocol.
C.The compute cluster's instance profile lacks write access to the S3 bucket.
D.The run_id 'xyz123' already exists and is locked by another user.
AnswerC

This is the most common cause for permission errors when interacting with S3 from Databricks. The instance profile or service principal attached to the cluster must have explicit IAM permissions granted to write to the specific bucket path. Without these permissions, all write operations will be blocked by the cloud provider.

Why this answer

The 'Permission denied' error indicates that the identity running the Databricks notebook or job lacks the necessary IAM permissions to write to the specified S3 bucket. In Databricks, interacting with external storage requires proper instance profile or service principal configuration. This error underscores the importance of cloud identity and access management (IAM) in ML workflows, as secure, authorized access to storage is foundational for maintaining the integrity and security of model artifacts during the development lifecycle.

Exam trap

Candidates often blame incorrect MLflow syntax for bucket write failures, overlooking cloud-level permissions like the compute cluster's instance profile configuration.

249
MCQeasy

A data scientist is using Databricks Feature Store to create a feature table for a machine learning model. They want to ensure that the features used during training are consistent with those used during inference. Which Databricks Feature Store capability should they use?

A.Feature Store's integration with MLflow to log the model with feature specifications.
B.Feature Store's point-in-time lookups to avoid data leakage during training.
C.Feature Store's ability to materialize features to an online store for low-latency serving.
D.Feature Store's automatic lineage tracking to trace feature transformations.
AnswerA

When you log a model with Databricks Feature Store, the model metadata includes the feature specifications. At inference time, the model can automatically look up the required features from the Feature Store, ensuring that the same transformations and data sources are used. This guarantees consistency between training and serving.

Why this answer

The correct answer is Feature Store's integration with MLflow to log the model with feature specifications. When a model is trained and logged using Databricks Feature Store, the feature specifications are stored with the model. During inference, the model automatically retrieves features from the Feature Store using those specifications, ensuring that the same features and transformations are applied.

This eliminates training-serving skew. Other capabilities like lineage, point-in-time lookups, and online stores are valuable but do not directly enforce consistency.

Exam trap

The trap here is confusing feature store capabilities that improve governance or latency with the mechanism that ensures training/serving consistency, which is the model's feature specifications.

250
MCQhard

Refer to the exhibit. A Databricks job failed to start, returning the error shown. The job depends on MLflow for tracking. What is the most likely cause of this failure?

A.The Databricks Runtime version is too recent and contains a breaking change.
B.The cluster library configuration is missing the required MLflow package.
C.The MLflow tracking server is currently unreachable due to network security policies.
D.The job cluster has insufficient memory to load the MLflow dependency.
AnswerB

This error occurs when the driver or worker nodes lack the MLflow library. Since the job fails during initialization, it indicates that the environment definition for the job cluster does not include MLflow, preventing the code from accessing the tracking client at runtime during the start-up sequence.

Why this answer

The ClassNotFoundException indicates that the MLflow library is missing from the runtime environment of the job cluster. In Databricks, if a job is configured to use a custom or minimal environment, essential libraries must be explicitly installed. This error highlights the importance of dependency management in production ML workflows, ensuring that all necessary packages are present in the cluster environment to prevent execution failures during automated deployment or batch scoring jobs.

Exam trap

Test-takers frequently suspect corrupted model code when a job fails with a ClassNotFoundException, missing that required cluster libraries are simply uninstalled.

251
MCQhard

Refer to the exhibit. A data scientist is logging a model to MLflow. Why is including an 'input_example' highly recommended in this specific code snippet?

A.It forces the model to retrain every time it is loaded into production.
B.It allows MLflow to validate the schema and ensures the model is compatible with deployment endpoints.
C.It automatically encrypts the model artifacts for security compliance.
D.It creates a dummy model version that cannot be used for inference.
AnswerB

Input examples provide a sample of the data expected by the model. MLflow uses this to infer and validate the schema, which is then used by Databricks Model Serving to verify incoming requests. This prevents deployment failures by ensuring the service endpoint knows exactly what input format to expect.

Why this answer

The input_example acts as a validation mechanism that MLflow uses to verify that the model can successfully process incoming data. It also enables automatic schema inference, which is crucial for downstream services like Model Serving. By providing this example, developers ensure that the model registry has metadata that allows for schema validation at serving time, reducing the risk of runtime errors when the model is deployed to production endpoints.

Exam trap

Candidates often overlook that input examples are not just for humans; they are technical requirements for the Model Serving endpoint to validate incoming request schemas.

252
MCQmedium

A data scientist wants to speed up the process of finding the optimal hyperparameters for a machine learning model. Which Databricks-supported library is optimized for distributed hyperparameter tuning?

A.Pandas
B.Hyperopt
C.Matplotlib
D.MLflow Tracking
AnswerB

Hyperopt is a library designed specifically for distributed hyperparameter optimization. When combined with SparkTrials on Databricks, it allows for massive parallelization of hyperparameter search, enabling efficient exploration of complex model parameter spaces by distributing trials across available cluster nodes, which is essential for deep learning and boosting models.

Why this answer

Hyperopt is a widely used Python library for distributed hyperparameter optimization. In Databricks, it integrates seamlessly with Spark, allowing the distribution of trial runs across a cluster of nodes. This dramatically reduces the time required to search through large hyperparameter spaces, enabling data scientists to train more complex models and achieve better performance in a fraction of the time compared to serial tuning.

253
Multi-Selecthard

A data scientist is using Databricks Feature Store to create a feature table for a recommendation model. They want to ensure that the feature table can be used for both training and batch scoring, and that it supports point-in-time correctness. Which two actions must they take when creating the feature table? (Choose two.)

Select 2 answers
A.Set the table as a streaming table.
B.Define a primary key for the feature table.
C.Partition the feature table by the primary key.
D.Specify a timestamp key for point-in-time correctness.
E.Enable time travel on the feature table.
AnswersB, D

Defining a primary key is essential for a feature table in Databricks Feature Store. The primary key uniquely identifies each entity (e.g., user_id, item_id) and is used to join features to training data and for online serving. Without a primary key, the feature table cannot be properly registered or used for lookups, and point-in-time correctness relies on the key to match features to the correct entity at the correct time.

Why this answer

To create a feature table in Databricks Feature Store that supports training, batch scoring, and point-in-time correctness, the data scientist must define a primary key and a timestamp key. The primary key identifies entities for joins, and the timestamp key enables time-aware joins to prevent leakage. Other actions like enabling time travel manually, partitioning, or using streaming tables are not required and may be unnecessary or counterproductive.

Thus, the correct choices are defining a primary key and specifying a timestamp key.

Exam trap

The trap here is assuming that time travel must be manually enabled or that partitioning is required, rather than focusing on the key definitions.

254
MCQhard

What is the primary technical limitation when deploying an MLflow model that has custom Python dependencies not included in the standard Databricks Runtime?

A.The model will automatically install the missing libraries.
B.The model will be rejected by the registry.
C.The serving container will fail due to missing runtime libraries.
D.The model cannot be used with MLflow.
AnswerC

If the model's environment specification does not include all necessary Python libraries, the container environment will lack the code required to execute the model's logic. This results in runtime errors or container startup failures because the serving engine cannot resolve the imports required by the model's execution code.

Why this answer

When using custom libraries, the inference environment must be able to install and manage these dependencies. MLflow handles this by utilizing environment specifications (like Conda or pip requirements). If these dependencies are not explicitly defined or cannot be resolved at deployment time, the serving container will fail to start.

This highlights the importance of properly managing the environment specification to ensure the target serving infrastructure has the necessary software components available.

Exam trap

Many test-takers blame code syntax errors for deployment failures, missing that missing runtime environment dependencies cause serving containers to fail at startup.

255
MCQmedium

A data scientist is using Databricks AutoML to train a classification model on a dataset with a binary target. They want to understand which features contributed most to the model's predictions and need a human-readable summary. Which AutoML output should they examine?

A.The MLflow run's artifact directory, specifically the 'feature_importance.json' file.
B.The AutoML-generated notebook that includes a section on model interpretability with SHAP values.
C.The Databricks Feature Store UI, which shows feature lineage and importance scores.
D.The Model Registry's version description, which is automatically populated with feature importance by AutoML.
AnswerB

Databricks AutoML generates a notebook for each trial that includes data exploration, model training, and interpretability using SHAP. The notebook provides summary plots and feature importance rankings, which are human-readable and explain how features affect predictions.

Why this answer

AutoML generates a notebook for each trial that includes model interpretability using SHAP. This notebook contains summary plots and feature importance rankings that are human-readable and explain the model's predictions. Examining this notebook is the correct way to understand feature contributions.

Exam trap

The trap here is assuming that feature importance is stored in a generic artifact or the Model Registry, when AutoML provides it in the generated interpretability notebook.

256
MCQmedium

Which technique is most effective for handling high-cardinality categorical features when training a tree-based model on Databricks?

A.One-hot encoding for all categorical variables.
B.Target encoding, replacing labels with the mean of the target variable.
C.Standardization using a StandardScaler.
D.Removing all categorical features entirely.
AnswerB

Target encoding maps categories to the average value of the target for that specific category. This drastically reduces the dimensionality compared to one-hot encoding. It is particularly effective for tree-based models, as it captures the relationship between the category and the target without creating an unmanageable number of features.

Why this answer

Target encoding or utilizing native categorical support in libraries like LightGBM or CatBoost is highly effective for high-cardinality features. These methods prevent the dimensionality explosion associated with one-hot encoding, which would otherwise lead to sparse, massive feature matrices that degrade training performance and memory efficiency. By handling categories internally, models maintain predictive power while remaining performant in distributed Databricks environments.

Exam trap

Candidates frequently choose one-hot encoding, ignoring that it causes feature explosion and performance degradation with high-cardinality features in distributed tree-based models.

257
Multi-Selectmedium

A team is preparing to deploy an MLflow model to a Databricks Model Serving endpoint and wants to diagnose why requests are failing before contacting support. Which two actions allow them to inspect the endpoint's behavior and errors? (Choose two.)

Select 2 answers
A.Re-register the model with a new signature and redeploy the endpoint to force the error to surface in the UI.
B.Query the endpoint's event logs and metrics in the Databricks workspace to review build and update events.
C.SSH into the serving container and read the application log files directly from the filesystem.
D.Enable inference tables on the endpoint to capture request and response payloads in a Delta table.
E.Attach a notebook to the serving cluster and run the model's predict method interactively to reproduce the error.
AnswersB, D

Endpoint event logs and metrics expose provisioning, build, and update events along with latency and error rates. These reveal whether the failure is a deployment or configuration problem, such as a failed model build or a scaled-to-zero event, complementing request-level payload inspection from inference tables.

Why this answer

Inference tables capture the actual request and response payloads, exposing malformed inputs and model-side errors, while endpoint event logs and metrics show deployment, scaling, and update events. Together they cover both request-level and infrastructure-level diagnosis. Attaching clusters, SSH access, and redeploying do not provide supported visibility into a managed serving endpoint's runtime.

Exam trap

The trap here is assuming serving endpoints can be inspected like interactive clusters, when diagnostics rely on inference tables and endpoint logs instead.

258
MCQmedium

A machine learning engineer needs to track hyperparameter tuning runs and log artifacts using MLflow inside a Databricks Notebook. Which approach should be used to ensure runs are automatically nested under a parent run?

A.Call mlflow.start_run() inside a loop without any arguments while an active run exists.
B.Utilize mlflow.start_run(nested=True) inside the hyperparameter optimization loop while a parent run is active.
C.Set the MLFLOW_PARENT_RUN_ID environment variable manually before invoking mlflow.start_run().
D.Configure the MLflow client to use a hierarchical tracking URI scheme before logging parameters.
AnswerB

The nested=True argument tells MLflow to create a child run under the currently active parent run context. This maintains proper organization in the tracking UI, allowing clean grouping of multiple training iterations associated with a single overarching optimization experiment.

Why this answer

Using `mlflow.start_run()` with a `nested=True` parameter ensures that child runs are correctly organized beneath an active parent run within the MLflow tracking server. This hierarchical structuring is essential for organizing complex hyperparameter optimization sweeps, enabling data scientists to easily compare child performance metrics against the overarching parent experiment trial in the Databricks UI.

Exam trap

Candidates often run multiple mlflow.start_run() calls without nesting, leading to cluttered dashboards. They fail to use the nested parameter, which is specifically designed for hierarchical hyperparameter tuning organization.

259
MCQmedium

A machine learning engineer is deploying a model using MLflow Model Serving on Databricks. They want to ensure the endpoint can handle bursts of traffic and automatically scale. Which configuration should they set when creating the served model?

A.Enable 'autoscaling' by setting the 'autoscale' flag to true in the served model configuration.
B.Set the 'scale_to_zero_enabled' parameter to true to allow the endpoint to scale down to zero when idle.
C.Set the 'workload_size' parameter to 'Large' to handle high traffic volumes.
D.Configure the 'min_replicas' and 'max_replicas' parameters to define the scaling range for the endpoint.
AnswerD

MLflow Model Serving on Databricks uses the min_replicas and max_replicas parameters to control automatic scaling. Setting a minimum ensures baseline capacity, while the maximum allows the endpoint to scale out during traffic bursts. This configuration enables the serving infrastructure to dynamically adjust replicas based on load.

Why this answer

To handle traffic bursts with automatic scaling, you must configure the min_replicas and max_replicas parameters. These define the range within which the serving infrastructure can dynamically add or remove replicas based on incoming request load, ensuring the endpoint scales out during peaks and scales in during lulls.

Exam trap

The trap here is confusing the workload_size parameter, which controls per-replica resources, with the replica count parameters that enable horizontal scaling.

260
MCQmedium

Which of the following is a primary benefit of using a model serving endpoint versus a batch inference job?

A.Lower cost for infrequent predictions
B.Real-time, low-latency inference
C.Ability to process billions of rows at once
D.Simplified tracking of data lineage
AnswerB

Serving endpoints are designed for low-latency, synchronous request-response cycles. They expose the model via an API, allowing applications to request a prediction and receive it in milliseconds. This is the defining requirement for real-time applications where end-user interaction is waiting for the model result.

Why this answer

Model serving endpoints provide low-latency, real-time responses to individual requests via REST APIs. This is essential for applications like fraud detection or recommendation engines, where an immediate prediction is required for a user interaction. Batch inference jobs, conversely, are designed for high-throughput, asynchronous processing of large datasets at scheduled intervals.

Understanding these use cases is vital for selecting the correct deployment architecture to meet performance and latency requirements.

Exam trap

Candidates conflate batch processing with real-time serving. They assume serving endpoints are for throughput, missing that the primary advantage is low-latency, immediate response for individual requests.

261
MCQmedium

What is the primary role of the 'Model Signature' in a Databricks ML lifecycle?

A.To identify which user trained the model for audit logs.
B.To enforce input schema validation at serving time.
C.To increase the prediction accuracy by normalizing inputs.
D.To compress the serialized model file size for faster loading.
AnswerB

The signature contains the schema information (e.g., column names and types) required to validate input data. When a model is served, the endpoint uses this signature to check if incoming requests adhere to the expected format, immediately rejecting any invalid payloads and preventing downstream runtime errors.

Why this answer

The Model Signature defines the schema of the inputs and outputs, serving as a formal contract. This contract is used by the serving infrastructure to validate incoming requests, ensuring that they match the expected format. It helps catch errors early in the deployment lifecycle, protecting production endpoints from malformed data.

By providing this metadata, developers ensure that their model is compatible with the standard Databricks serving interfaces, enabling seamless integration into production applications.

Exam trap

Candidates often confuse the model signature with model performance metrics or training logs, missing its functional purpose as a schema validator for incoming production traffic.

262
MCQhard

An ML engineer registers a model to the Databricks Model Registry and moves it to the 'Production' stage. A downstream batch scoring job references the model as models:/churn_model/Production. A data scientist then registers a new model version and transitions it to 'Production'. What happens to the downstream batch scoring job the next time it runs?

A.The job fails because a model URI cannot reference a stage once more than one version has occupied that stage.
B.The job continues to load the previously promoted version, because model URIs are cached and pinned at the time the job was first created.
C.The job loads the newly promoted Production version automatically, because the models:/churn_model/Production URI resolves to whichever version currently holds that stage.
D.The job loads the newest registered version regardless of stage, because the models:/ URI ignores stage names and always selects the highest version number.
AnswerC

Stage-based URIs such as models:/churn_model/Production are resolved at load time to the model version currently assigned to that stage. After the new version is transitioned to Production, the next job run picks up that version, enabling controlled rollout without changing job code, which is exactly the intended behavior.

Why this answer

Stage-based model URIs like models:/churn_model/Production resolve dynamically at load time to the version currently assigned to that stage. When a new version is transitioned into Production, subsequent scoring runs automatically use it, allowing controlled promotion without editing job code. The URI is not pinned or cached at job creation.

Exam trap

The trap here is assuming stage URIs are pinned when a job is defined, when they are actually resolved dynamically at each model load.

263
MCQeasy

A data scientist registers a model in the Databricks Model Registry and wants to record the model's intended input and output schema so that a serving endpoint can validate incoming requests. Which action accomplishes this when logging the model?

A.Add the schema to the endpoint's tags in the serving configuration
B.Store the schema as a separate Delta table and reference it in the model's README
C.Log the model with an inferred or explicit signature using MLflow
D.Set the model version's stage to Production in the Model Registry
AnswerC

Logging the model with a signature records the expected input and output schema in the MLflow model artifact. Model Serving reads that signature to validate request payloads, so this is the correct way to enable schema validation and prevent malformed inputs from reaching the model.

Why this answer

A model signature is part of the logged MLflow model artifact and is what the serving runtime uses to validate request payloads against expected input and output types. Registry stages, endpoint tags, and external documentation are metadata that the runtime does not interpret as a schema, so only logging the model with a signature achieves request validation.

Exam trap

The trap here is assuming registry stages or endpoint tags carry schema information, when only the logged MLflow model signature drives request validation.

264
MCQmedium

A machine learning engineer is using Databricks Feature Store to create a feature table for a model that predicts customer churn. The feature table includes customer demographics and transaction history. The engineer wants to ensure that the model can access the latest feature values during online inference. What should the engineer do?

A.Enable change data feed on the feature table to capture updates.
B.Set up a Databricks SQL warehouse to query the feature table.
C.Publish the feature table to an online store using the Databricks Feature Store API.
D.Use MLflow to log the feature table as a model artifact.
AnswerC

Publishing the feature table to an online store makes the features available for low-latency lookups during online inference. The Databricks Feature Store supports online stores like Amazon DynamoDB or Azure Cosmos DB, enabling real-time serving of feature values. This is required to ensure the model can access the latest features at inference time.

Why this answer

To serve features for online inference, the feature table must be published to an online store. Databricks Feature Store provides APIs to publish feature tables to low-latency databases, enabling the model to retrieve the latest feature values in real time. This is a key step when deploying models that require online features, ensuring consistency between training and serving.

Exam trap

The trap here is confusing Delta Lake features like change data feed with online serving capabilities, which require a dedicated online store.

265
MCQhard

A data scientist trains a model with MLflow on Databricks and logs it using mlflow.sklearn.log_model with a registered_model_name. A downstream batch job loads the model by stage using models:/<name>/Staging. Weeks later, a colleague promotes a new version to Staging and the batch job's predictions change without any code deployment. Which change best prevents unintended downstream consumption while keeping promotion workflows intact?

A.Archive the previous versions in the Model Registry before each promotion.
B.Add a model signature and re-log the model with registered_model_name.
C.Load the model by explicit version URI instead of by stage.
D.Set the batch job to load the model from the run's artifact URI in the tracking server.
AnswerC

A version-based URI such as models:/<name>/3 resolves to one immutable artifact, so promoting a different version to Staging cannot alter what the batch job consumes. Promotion workflows in the Registry still function for other consumers. This decouples the batch job from stage transitions while preserving the governance and approval process the team relies on.

Why this answer

Stage-based URIs are mutable pointers: whatever version is transitioned into a stage becomes the artifact that stage references. Pinning a consumer to an explicit model version makes its dependency immutable, so later promotions affect only consumers that intentionally follow stages. This preserves Registry-based promotion while eliminating silent behaviour changes in the batch job.

Exam trap

The trap here is believing that a model signature or archiving old versions freezes what a stage-based URI returns, when only an explicit version reference is immutable.

266
MCQeasy

A data scientist has trained a scikit-learn model and wants to expose it for real-time inference through Databricks Model Serving. The model is currently logged as an MLflow run artifact but has not been registered anywhere. What must the data scientist do before creating the serving endpoint?

A.Convert the model to an ONNX file for cross-platform compatibility.
B.Register the model in Unity Catalog and note the model name and version.
C.Export the model to a pickle file and upload it to DBFS.
D.Create a Databricks job that runs the model on a schedule.
AnswerB

Databricks Model Serving creates endpoints from registered model versions, referencing a three-level Unity Catalog name such as catalog.schema.model and a version number. Registering the logged model makes the artifacts, signature, and environment metadata available for the serving layer to build and deploy. Without a registered version, there is no model entity the endpoint can point to, so registration is the required prerequisite.

Why this answer

Databricks Model Serving deploys registered model versions, referencing a Unity Catalog model name and version. Logging a model during training stores artifacts but does not make the model deployable until it is registered. Once registered, the endpoint can be created against that version, and the serving layer uses the stored signature and environment to build the container.

Raw file uploads, format conversions, and scheduled jobs do not satisfy this prerequisite.

Exam trap

The trap here is treating a logged MLflow artifact as directly deployable, when Model Serving actually requires a registered model version to point the endpoint at.

267
MCQhard

An ML engineer runs a hyperparameter tuning job on Databricks using Hyperopt with SparkTrials. The objective function trains a model and returns a validation metric. The engineer notices that each trial logs to the same MLflow run, making it impossible to compare trials. What should the engineer do to ensure each trial appears as a separate MLflow run?

A.Use mlflow.set_tag to assign a unique trial ID tag before logging metrics.
B.Pass a unique run_name argument to mlflow.log_metric for each trial.
C.Call mlflow.start_run(nested=True) at the beginning of the objective function.
D.Set the environment variable MLFLOW_EXPERIMENT_ID to a unique value inside the objective function.
AnswerC

SparkTrials creates a parent run for the tuning job and, when the objective function opens a nested run with mlflow.start_run(nested=True), each trial is logged as a child run under that parent. This yields one run per trial with its own parameters and metrics, enabling comparison in the MLflow UI. Databricks documents this pattern for distributed hyperparameter tuning.

Why this answer

With Hyperopt and SparkTrials on Databricks, the tuning job creates a parent MLflow run. To capture each trial separately, the objective function must open a nested run using mlflow.start_run(nested=True). This produces child runs per trial, each with its own parameters and metrics, which can be compared in the MLflow experiment UI.

Tags, metric names, or experiment changes do not create distinct runs.

Exam trap

The trap here is thinking that tagging or renaming metrics separates trials, when only creating a nested run per trial actually produces distinct MLflow runs.

268
MCQhard

Which approach is most efficient for handling high-cardinality categorical features in a machine learning model while maintaining compatibility with standard Databricks model serving?

A.One-hot encoding the features inside the model inference function.
B.Using the Feature Store to store pre-computed embeddings.
C.Converting features to strings and letting the model handle them natively.
D.Running a Spark job on every prediction request to re-encode the features.
AnswerB

Storing pre-computed embeddings in the Feature Store is the most efficient way to handle high-cardinality features. It offloads the transformation logic from the real-time inference request, allowing the model to receive dense, meaningful representations. This significantly reduces latency and ensures consistent model performance in a production environment with high-cardinality data inputs.

Why this answer

Using Feature Store to pre-compute and transform high-cardinality features allows you to store them as embeddings or encoded vectors. This shift moves the expensive computation from the inference phase to an offline batch process, significantly reducing latency. This approach is compatible with standard model serving, as the model only receives the pre-calculated features, ensuring consistent and performant real-time inference within the Databricks ecosystem.

Exam trap

Candidates often suggest performing real-time one-hot encoding or dynamic embedding generation during inference, which causes massive latency issues.

269
MCQmedium

A data scientist trains a scikit-learn model in a Databricks notebook and calls mlflow.sklearn.log_model with the registered_model_name argument set to 'churn_model'. Later, a colleague needs to know which source notebook and Git commit produced run ID 3f8a1c. Where can this information be retrieved?

A.In the MLflow run's artifact directory, open the conda.yaml file, which records the source notebook path and Git commit used during training.
B.In the Databricks Model Registry, open version 1 of churn_model and read the 'Source' field, which stores the originating notebook path and Git commit.
C.In the MLflow Experiment page, open the run and inspect the run's tags, including mlflow.source.name and mlflow.source.git.commit.
D.In the Databricks Jobs UI, locate the task that ran the notebook and read its run history, which stores the MLflow run ID and its source metadata.
AnswerC

MLflow automatically records the source notebook path, Git commit, and other environment metadata as tags on every run. Opening the run in the experiment UI and viewing its tags reveals exactly which notebook and Git revision generated run 3f8a1c, satisfying the colleague's need without any extra instrumentation.

Why this answer

MLflow automatically attaches metadata tags to each run, including the source notebook path, Git commit, and user. These tags are visible on the run detail page in the experiment UI, making it the authoritative place to trace a run back to its originating notebook and revision. Registry entries and artifact files like conda.yaml do not carry this provenance.

Exam trap

The trap here is assuming the Model Registry stores full source provenance, when that metadata actually belongs to the MLflow run tags in the experiment.

270
MCQmedium

A data scientist registers a scikit-learn model in the Unity Catalog model registry with the name `prod.ml_team.fraud_detector`. They now want to serve it with Databricks Model Serving. Which value should be supplied as the model identifier when creating the serving endpoint?

A.prod.ml_team.fraud_detector
B.models:/prod.ml_team.fraud_detector/Production
C.dbfs:/databricks/mlflow/prod/ml_team/fraud_detector
D.runs:/<run_id>/model
AnswerA

Unity Catalog models are referenced by their fully qualified three-level name, catalog.schema.model_name, so prod.ml_team.fraud_detector is exactly the identifier Model Serving expects. Because the model lives in Unity Catalog rather than the workspace registry, the endpoint resolves the model version directly from that namespace, and permissions on the catalog, schema, and model govern who can serve it.

Why this answer

Because the model was registered in Unity Catalog, the endpoint must be created from the three-level namespace catalog.schema.model_name, optionally pinned to a version. Stage-based URIs and raw storage or run paths do not identify a Unity Catalog registered model, so they cannot be used as the served entity. The fully qualified name is the correct identifier.

Exam trap

The trap here is assuming that MLflow stage-based URIs like models:/name/Production still work for models registered in Unity Catalog, when Unity Catalog models are addressed by their three-level name and use aliases instead of stages.

271
MCQeasy

When performing hyperparameter tuning using Hyperopt on Databricks, which function is primarily used to distribute the training task across the cluster?

A.fmin()
B.SparkTrials()
C.parallel_task()
D.distributed_fit()
AnswerB

SparkTrials is the specific class designed to integrate Hyperopt with Spark. It handles the distribution of trial configurations across cluster workers, managing synchronization and results collection. This allows users to scale their hyperparameter optimization jobs seamlessly without needing to write custom distributed computing logic for every new experiment.

Why this answer

Hyperopt leverages the SparkTrials class to distribute tuning tasks. By using SparkTrials, Databricks orchestrates multiple training trials in parallel across the cluster nodes, significantly reducing the time required for grid or random search. This integration is vital for efficiently exploring complex hyperparameter spaces, allowing data scientists to iterate faster on model architectures without manual resource management or complex parallelization code.

Exam trap

Students frequently choose standard local Hyperopt evaluation functions instead of SparkTrials, resulting in unscaled single-node hyperparameter tuning runs.

272
MCQmedium

An ML engineer wants to package a training project so it can be run reproducibly from a Databricks Job across environments, with its Python dependencies and entry point defined. Which MLflow capability should be used?

A.MLflow Tracking, by logging parameters and metrics for each run.
B.MLflow Recipes, by defining a step-based pipeline with profiles.
C.MLflow Projects, using an MLproject file to declare the entry point and environment.
D.MLflow Models, by saving the estimator with a signature.
AnswerC

MLflow Projects define a reusable, reproducible unit through an MLproject file that names the entry point, parameters, and environment specification such as a conda or pip requirements file. Running the project creates a run with recorded parameters and source, which supports reproducibility across environments and integrates with Databricks Jobs as a project task.

Why this answer

MLflow Projects are the packaging mechanism for reproducible runs: the MLproject file specifies the entry point and the environment via a conda or pip specification, and executing the project records source and parameters in a run. Models capture artifacts, Tracking records results, and Recipes impose a specific template, so none of those define a reusable training entry point with dependencies for a Databricks Job.

Exam trap

The trap here is conflating MLflow Models or Tracking with reproducibility packaging, when defining an entry point and dependencies is the job of MLflow Projects.

273
MCQmedium

A data scientist trains a model with a feature engineering pipeline and wants batch scoring to happen nightly on a Delta table using Databricks, producing predictions that downstream dashboards read. The scoring job must scale with data volume and be re-runnable if it fails. Which approach best fits these requirements?

A.Deploy the model to a real-time Model Serving endpoint and call it row by row from a notebook loop.
B.Export the model to a pickle file and have the dashboard application load and score records on demand.
C.Use MLflow's predict API to load the model in a Spark job and score the Delta table with a distributed DataFrame.
D.Convert the model to a SQL UDF and run a single-threaded query against the feature table.
AnswerC

Loading the model with the MLflow predict API inside a Spark job lets the scoring run distributed across the cluster, so throughput scales with the data volume and executor count. The job can be scheduled with a Databricks job and retried on failure, and results are written back to Delta for dashboards. This aligns with a nightly, re-runnable bulk scoring pattern.

Why this answer

Nightly bulk scoring on a Delta table is a distributed batch workload, so the model should be loaded with the MLflow predict API inside a Spark job that reads the feature table and writes predictions back to Delta. That approach scales horizontally with data volume and integrates cleanly with Databricks job scheduling and retries, unlike endpoint-per-row calls, dashboard-embedded pickles or single-threaded SQL.

Exam trap

The trap here is assuming a real-time serving endpoint is the default way to use a model, when scheduled distributed batch scoring is the appropriate pattern for bulk table data.

274
MCQmedium

A data scientist registers a scikit-learn model in Unity Catalog as `prod.ml.churn_model`. They then create a Databricks Model Serving endpoint via the REST API using `served_entities` with `entity_name` set to `prod.ml.churn_model` and `entity_version` set to `"3"`. The endpoint creation fails. What is the most likely cause?

A.Model Serving only supports models registered in the workspace Model Registry, not models registered in Unity Catalog.
B.The model version must be referenced as a numeric integer, but the field only accepts a string, so the deployment cannot resolve the artifact path.
C.The model must first be exported to DBFS as an MLflow artifact tarball before it can be referenced by a serving endpoint.
D.The serving endpoint lacks USE CATALOG, USE SCHEMA, and EXECUTE privileges on the Unity Catalog model, so the service principal cannot read the model artifacts.
AnswerD

Databricks Model Serving authenticates as a platform-managed identity and requires explicit Unity Catalog grants on the model's parent catalog, schema, and the model itself. Without USE CATALOG, USE SCHEMA, and EXECUTE on `prod.ml.churn_model`, the endpoint cannot fetch artifacts and creation fails. Granting these to the serving identity or the requesting user resolves the deployment.

Why this answer

Serving a Unity Catalog model requires the serving identity to hold USE CATALOG, USE SCHEMA, and EXECUTE privileges on the catalog, schema, and model. Without these grants, the endpoint cannot retrieve the model version, and creation fails. Referencing the model by three-level name and version string is otherwise correct, so permissions are the most likely root cause.

Exam trap

The trap here is assuming that a user who can view a Unity Catalog model in the UI automatically has the EXECUTE privilege required for Model Serving to load the artifacts.

275
Multi-Selecthard

Which THREE actions are best practice when deploying a machine learning model using Databricks Model Serving?

Select 3 answers
A.Hardcode API credentials directly into the model inference script.
B.Ensure the model signature is defined to enable input validation.
C.Utilize the Model Registry to manage the versioning of the deployed model.
D.Perform inference on the same cluster used for training to save costs.
E.Implement logging within the inference function to monitor performance.
AnswersB, C, E

Defining a model signature allows the serving endpoint to validate incoming request data against the expected schema. This prevents runtime errors and unexpected model behavior by rejecting malformed input, which is a crucial safeguard for stable and reliable production-grade ML inference services in a distributed environment.

Why this answer

Databricks Model Serving provides a managed endpoint for low-latency inference. Adopting best practices for deployment—such as using environment variables, ensuring proper logging, and testing in staging—is essential for maintaining reliable, scalable, and secure production services. These practices ensure that the serving infrastructure is decoupled from the training environment, adheres to security policies, and provides observability into model performance in real-world conditions, effectively bridging the gap between model development and operational deployment.

Exam trap

Candidates frequently overlook model signatures as optional, whereas they are mandatory best practices for payload validation and seamless model serving integration.

276
MCQmedium

A data scientist is using MLflow on Databricks to track experiments. After running several training jobs, they notice that the run metrics are recorded but the model artifact is missing when they view the run details. They logged the model using the default MLflow API. What is the most likely cause?

A.The model was too large to be stored in the MLflow artifact store, so it was automatically skipped.
B.The model was logged using mlflow.sklearn.log_model, but the run was not ended, so artifacts are not persisted.
C.The MLflow tracking server was not configured to log artifacts, so only metrics were recorded.
D.The model artifact was logged outside of the active MLflow run context, so it was not associated with the run.
AnswerD

MLflow associates artifacts with the active run. If log_model is called without an active run context, the model is saved to the artifact store but not linked to any run. The run metrics appear because they were logged within a run, but the model artifact is missing from that run's details. To fix, ensure logging occurs inside a with mlflow.start_run() block.

Why this answer

The model artifact is missing because log_model was called outside an active MLflow run, so it was not linked to the run. Metrics were logged within the run, explaining their presence. To ensure artifacts are associated, all logging calls must occur inside a run context created by mlflow.start_run().

This is a common oversight when refactoring code or using helper functions.

Exam trap

The trap here is assuming that logging a model automatically associates it with the most recent run, when MLflow requires an active run context.

277
MCQeasy

Which feature in Databricks allows a data scientist to version and manage the lifecycle of machine learning models in a centralized repository?

A.MLflow Experiments
B.Databricks Model Registry
C.Databricks Repos
D.Unity Catalog
AnswerB

The Model Registry provides a centralized location to manage the full lifecycle of MLflow models. It supports versioning, stage transitions, model annotations, and deployment triggers. This is the standard tool in Databricks for transitioning a model from experimentation to production, ensuring governance and reproducibility across the entire organization.

Why this answer

The Model Registry is the central component in Databricks for managing the model lifecycle. It allows users to transition models through stages like Staging, Production, and Archived. This structure is vital for large teams to ensure that only validated models are deployed to production environments, providing a clear audit trail and simplifying deployment workflows through versioning and stage-based access controls.

Exam trap

Candidates often confuse MLflow Tracking with the Model Registry, failing to realize that while tracking records experiments, the registry is the specific tool for managing model lifecycle stages.

278
MCQmedium

Why should you use an inference table in Databricks Model Serving?

A.To increase the speed of model inference
B.To automatically retrain the model on new data
C.To provide visibility into production inputs and predictions
D.To secure the endpoint against malicious attacks
AnswerC

Inference tables provide a permanent, queryable record of every inference call, including the input features and the resulting prediction. This is the foundation for monitoring, drift detection, and debugging. By logging this data to Delta tables, you gain full insight into how the model is being used in production.

Why this answer

Inference tables allow you to capture every request and response processed by a model endpoint. This is vital for monitoring model performance over time, debugging issues by examining specific input-output pairs, and detecting data drift. Without this captured data, you essentially have no visibility into how the model is performing in the real world, which makes it impossible to maintain and improve the system effectively.

Exam trap

Candidates think inference tables are for performance tuning or caching. They fail to realize the primary purpose is observability: tracking inputs and outputs for monitoring and drift detection.

279
MCQhard

An ML engineer has registered a model in the Databricks Model Registry. The model must be deployed to a REST endpoint that automatically scales with traffic and provides a stable serving environment. Which Databricks capability should they use?

A.Export the model as an MLflow artifact and load it in a Databricks notebook using mlflow.pyfunc.load_model for interactive scoring.
B.Databricks Model Serving with the registered model version as the served entity.
C.MLflow Model Registry webhooks that trigger a deployment script when the model version transitions to Production.
D.A Databricks job that runs a Python web server on a cluster and exposes the model via a public URL.
AnswerB

Databricks Model Serving is a fully managed, serverless solution that deploys registered model versions as REST endpoints with automatic scaling and a stable serving environment. It handles infrastructure, scaling, and monitoring, so the engineer only needs to select the model version and enable serving, meeting the deployment requirement without managing servers.

Why this answer

Databricks Model Serving provides a managed, serverless endpoint for registered model versions. It automatically scales with request volume and offers a stable serving environment, eliminating the need to run and maintain a web server. The other options either require manual server management or are intended for interactive or batch use, not production REST serving.

Exam trap

The trap here is thinking that any Python web server on a cluster constitutes model serving, when only Databricks Model Serving provides managed autoscaling and a stable endpoint.

280
MCQeasy

Which of the following is the recommended workflow for developing a scalable model on Databricks?

A.Train a model on a local machine, then upload the final artifact to Databricks.
B.Perform EDA, feature engineering, distributed training, and register with MLflow.
C.Use a single-node cluster for all stages to avoid network latency.
D.Skip logging metrics to save space and improve training speed.
AnswerB

This is the best-practice workflow on Databricks. It leverages the platform's capabilities for every stage of the lifecycle: distributed data processing (Spark), consistent feature management (Feature Store), efficient training, and standardized deployment via the MLflow Model Registry, resulting in a robust, reproducible, and production-ready machine learning pipeline.

Why this answer

The iterative cycle of data exploration, feature engineering, distributed training, and model registry management is the standard Databricks practice. By utilizing MLflow throughout, scientists ensure reproducibility. Scaling is handled by Spark, and the Feature Store ensures the same data definitions are used for both training and inference.

This workflow bridges the gap between ad-hoc experimentation and production-ready machine learning, ensuring that the model is robust, documented, and easily deployable via standard enterprise pipelines.

Exam trap

Candidates frequently select workflows that skip distributed training or register models outside of MLflow, breaking standard enterprise deployment patterns.

281
MCQmedium

A data scientist wants to package a training script so that it can be run repeatedly with different hyperparameters and shared with colleagues who use different Python library versions. The script must create a reproducible environment. Which MLflow component should they use to define the project and its dependencies?

A.MLflow Projects with an MLproject file and a conda.yaml environment specification.
B.MLflow Tracking with a dedicated experiment and run tags for each library version.
C.MLflow Models with a custom Python function flavor and a requirements.txt file.
D.MLflow Model Registry with stage transitions and model version descriptions.
AnswerA

MLflow Projects provide a standard format for packaging reusable code. The MLproject file defines entry points and parameters, while conda.yaml specifies the exact library versions. This allows colleagues to run the project with mlflow run and get a reproducible environment, satisfying both the parameterization and dependency isolation requirements.

Why this answer

MLflow Projects are designed to package code with a clear entry point and parameter definitions, and the conda.yaml file locks dependency versions for reproducibility. This lets colleagues run the same training script with different hyperparameters in an isolated environment. Tracking, Models, and the Model Registry serve different lifecycle stages and do not provide project packaging.

Exam trap

The trap here is equating MLflow Models or the Model Registry with project packaging, when only MLflow Projects define runnable entry points and environment specifications.

282
MCQmedium

A machine learning engineer needs to track model experiments in Databricks and wants to ensure that model artifacts are versioned automatically. Which approach best leverages Databricks-native capabilities for this requirement?

A.Manually save model weights to a DBFS mount point using a standard Python dictionary to track parameters.
B.Invoke mlflow.autolog() at the start of the training script to capture parameters, metrics, and model artifacts automatically.
C.Write a custom function to append training results to a Delta table and store serialized model objects as binary columns.
D.Use the standard Python logging module to output training metrics to a text file saved in the user home directory.
AnswerB

Autologging streamlines the development process by instrumenting popular libraries like Scikit-Learn or PyTorch to log data automatically. This ensures that every training run is captured with full metadata, reducing developer burden and preventing the common mistake of forgetting to log critical hyperparameters or evaluation metrics during rapid testing.

Why this answer

MLflow tracking is the standard in Databricks for recording experiments. Using mlflow.autolog() automatically captures parameters, metrics, and artifacts during model training runs, ensuring consistency and reproducibility across team members. This is essential for managing the model lifecycle, as it eliminates manual logging errors and provides a clear lineage from source code to the registered model artifact within the Unity Catalog or Model Registry environment.

Exam trap

Candidates often attempt to manually log parameters and metrics using individual API calls, missing that autologging is the preferred, automated way to ensure comprehensive artifact versioning.

283
MCQmedium

A data scientist is training a Random Forest model on a 500GB dataset using Databricks. They notice that the model training process is consistently running out of memory on the driver node. Which approach should be taken to resolve this memory bottleneck while maintaining model performance?

A.Increase the driver node instance size to match the total dataset volume.
B.Convert the dataset to a Pandas DataFrame and train using the Scikit-Learn library directly.
C.Use the Spark MLlib RandomForestRegressor implementation to distribute computation across workers.
D.Enable broadcast joins on the feature table before training the model.
AnswerC

Spark MLlib is specifically designed for distributed machine learning. By utilizing Spark's parallel processing capabilities, the data and computation are spread across worker nodes. This prevents the driver node from becoming a bottleneck, allowing the algorithm to scale effectively as the dataset size increases beyond local memory limits.

Why this answer

Random Forest models often store large ensembles and intermediate metadata in memory. When training on distributed data, using Spark ML's native distributed algorithms is essential. By moving computation to the worker nodes and leveraging the Spark RDD-based implementation, the driver node is relieved from holding the entire dataset or model state, allowing for successful training on larger datasets without frequent OOM errors that occur when pulling data locally.

Exam trap

Candidates try to increase driver memory or use pandas-based libraries to process the entire dataset locally. They ignore the distributed nature of Spark, which is required for large datasets.

284
MCQmedium

What is the primary function of the 'Model Registry' in the Databricks ML ecosystem?

A.To store raw training datasets for feature engineering
B.To provide a centralized platform for model lifecycle management
C.To execute distributed hyperparameter tuning experiments
D.To monitor real-time inference drift in production
AnswerB

The Model Registry acts as the central governance point for models. It provides functionalities for versioning, stage transitions (e.g., Staging to Production), and centralized model documentation, which is essential for ensuring that only approved, validated models are deployed into production environments within a controlled organizational workflow.

Why this answer

The Model Registry provides a centralized hub for managing the full lifecycle of a machine learning model. It allows teams to track versions, manage model stages (Staging, Production, Archived), and facilitate collaboration. By serving as a 'source of truth' for model status, it ensures that stakeholders can confidently transition models from development to production while maintaining complete audit trails and lineage of all changes applied to the model artifacts.

Exam trap

Candidates confuse the Model Registry with the MLflow Tracking UI. Tracking is for experiment metadata, whereas the Registry is specifically for managing the deployment lifecycle and model promotion stages.

285
MCQmedium

You are using Databricks Feature Store to create a feature table that will be used for both batch training and online inference. The feature table must be refreshed daily with new data, and the online store must serve the latest feature values within minutes of the refresh. Which configuration should you use?

A.Create a feature table with online=False, and configure Model Serving to read from the offline table at inference time.
B.Create a standard Delta table and manually export it to a key-value store each day using a notebook.
C.Create a feature table with online=True and use a Databricks Job to run a daily write that updates both the offline Delta table and the online store.
D.Create a feature table with online=True, but only write to it weekly to reduce costs.
AnswerC

Setting online=True when creating the feature table enables an online store (such as DynamoDB or SQL) alongside the offline Delta table. A daily job that writes to the feature table via FeatureStoreClient.write_table updates both stores, and the online store is refreshed with the new values. This meets the requirement for daily refresh and near-real-time online serving, as Databricks Feature Store publishes to the online store during the write.

Why this answer

A feature table created with online=True is backed by both an offline Delta table and an online store. Writing to it via FeatureStoreClient.write_table publishes the new feature values to both stores. Running this write in a daily Databricks Job refreshes the online store with the latest data, enabling low-latency serving within minutes.

Other options either omit the online store, use unsupported manual exports, or fail to meet freshness requirements.

Exam trap

The trap here is assuming that Model Serving can read directly from the offline Delta table, when online inference requires a feature table published to an online store.

286
MCQhard

You are deploying a model using MLflow, and you want to log the custom pre-processing logic alongside the model so it is automatically applied during inference. How should you achieve this?

A.Create a separate inference job that runs the pre-processing code before the model.
B.Use the mlflow.pyfunc.log_model() function with a custom code wrapper.
C.Store the pre-processing logic in a shared Delta table and call it at inference.
D.Log the pre-processing parameters as tags in the MLflow run and re-apply them.
AnswerB

The pyfunc flavor is the standard way to package custom logic with models in MLflow. It allows users to define a wrapper that executes arbitrary code, including pre-processing, at inference time. This ensures that the model is self-contained, simplifying deployment and guaranteeing that input data is processed correctly.

Why this answer

MLflow allows you to log custom Python functions or entire pipelines as part of the model using the 'pyfunc' flavor. By wrapping your pre-processing steps and model into a custom pyfunc class and logging it, you encapsulate both the transformation and the prediction logic. This is a critical best practice for production deployments, as it ensures consistent pre-processing between training and inference, eliminating training-serving skew and simplifying the deployment process for the serving endpoint.

Exam trap

Test-takers often select generic artifact logging functions instead of the specialized pyfunc wrapper required to bundle custom pre-processing logic with the model.

287
MCQhard

When using MLflow to track experiments, what happens if you invoke mlflow.end_run() inside a nested loop when the parent run is already active?

A.The entire experiment is deleted from the workspace.
B.The active run is terminated, and subsequent logging calls outside the loop will fail if they assume the run is active.
C.The parent run automatically restarts to compensate for the closed child run.
D.The nested loop continues, but logging is redirected to the default root run.
AnswerB

MLflow keeps track of the 'active run' state. If you terminate it explicitly, any following code that attempts to log data without starting a new run will throw an error. This is crucial to understand when writing loops, as scope management is necessary to maintain consistent logging patterns during execution.

Why this answer

Calling end_run() within a nested loop terminates the current active run. If it is part of a parent-child structure, ending the child prematurely could lead to incomplete data or orphaned metrics. Proper management requires careful scoping, often using context managers (with statements), to ensure that the run lifecycle is handled cleanly and that all sub-runs correctly report back to the primary experiment tracking context.

Exam trap

Candidates often call mlflow.end_run() inside loops without considering that it terminates the active run, which leads to subsequent logging failures or orphaned sub-runs.

288
MCQmedium

A data scientist needs to track parameters, metrics, and model artifacts during training on Databricks. Which approach is the industry-standard best practice to ensure reproducibility and lineage?

A.Manually save model artifacts to DBFS and document parameters in a spreadsheet.
B.Write all model logs to a local temporary folder on the driver node.
C.Use the MLflow Tracking API to log parameters and artifacts during the training run.
D.Deploy the model directly to production without logging parameters to save compute costs.
AnswerC

MLflow Tracking provides a robust, centralized API to record experiments. It automatically captures metadata, code versions, and artifacts, making them accessible via the Experiments sidebar. This ensures that every model training process is documented, searchable, and repeatable, which is foundational for maintaining high-quality machine learning model lifecycle management.

Why this answer

MLflow Tracking is the core component for logging parameters, metrics, and artifacts in Databricks. By integrating MLflow into the training script, data scientists create a centralized record of every experiment run. This allows for easy comparison between different model versions, facilitates team collaboration, and ensures that the exact code, environment, and hyperparameter configuration used to produce a specific model artifact can be audited and reproduced later in the MLOps lifecycle.

Exam trap

Candidates often rely on manual logging or external databases, ignoring the built-in MLflow Tracking API which is the industry standard for maintaining lineage and reproducibility in Databricks.

289
MCQmedium

A machine learning engineer is using MLflow Tracking on Databricks to compare multiple runs. They want to programmatically retrieve the best run based on a metric called 'rmse' from an experiment. Which MLflow API call should they use?

A.`mlflow.get_experiment_by_name()` and then filter runs by metric
B.`mlflow.get_run()` with the run ID of the best run
C.`mlflow.list_run_infos()` and manually iterate to find the minimum 'rmse'
D.`mlflow.search_runs()` with `order_by=['metrics.rmse ASC']`
AnswerD

`mlflow.search_runs()` returns a pandas DataFrame of runs and supports ordering by metrics. Using `order_by=['metrics.rmse ASC']` sorts runs by the 'rmse' metric in ascending order, so the first row is the run with the lowest RMSE. This is the correct programmatic way to retrieve the best run.

Why this answer

`mlflow.search_runs()` is designed to query runs within an experiment and can order results by metrics. By specifying `order_by=['metrics.rmse ASC']`, the run with the lowest RMSE appears first. This is efficient and programmatic, unlike manually iterating runs or using functions that retrieve single runs or experiment metadata.

Exam trap

The trap here is assuming that `mlflow.get_run()` or `mlflow.list_run_infos()` can directly sort or filter runs by metrics, when they either require a known run ID or lack metric data.

290
MCQhard

Refer to the exhibit. Why is including the `signature` and `input_example` in the `log_model` call considered a professional best practice?

A.It forces the model to run on a GPU during inference.
B.It speeds up the model training process.
C.It enables schema validation and improves model serving usability.
D.It reduces the storage size of the model artifact.
AnswerC

Signatures provide a clear contract for the model, enabling automatic validation of input data. Input examples help serving tools generate accurate API definitions, making it easier for external applications to call the model. This reduces integration friction and ensures that only valid data is passed to the model.

Why this answer

Providing a signature and input example allows MLflow to define the expected schema for the model. This metadata facilitates automatic type validation and allows the model serving infrastructure to generate accurate API documentation. This is critical for downstream consumers who need to integrate the model, as it prevents runtime integration errors and clarifies the interface expectations before the model is even deployed into production.

Exam trap

Candidates often view signatures as optional metadata, failing to realize they provide the essential interface documentation and validation required for seamless downstream integration by other services.

291
MCQeasy

A data scientist has registered a model in the Databricks Model Registry and wants to deploy it as a REST API endpoint for real-time inference. Which Databricks feature should they use?

A.Databricks Jobs
B.MLflow Tracking
C.Databricks SQL Analytics
D.MLflow Model Serving
AnswerD

MLflow Model Serving in Databricks provides a fully managed, scalable endpoint for real-time inference of models registered in the Model Registry. It handles deployment, scaling, and monitoring, and exposes a REST API. This directly matches the requirement to serve a registered model as a REST endpoint without managing infrastructure.

Why this answer

For real-time inference of registered models, Databricks offers MLflow Model Serving, which creates a managed REST endpoint. It integrates with the Model Registry, allowing you to serve specific model versions with automatic scaling. Other options are for analytics, tracking, or batch processing, not for serving models as APIs.

Exam trap

The trap here is confusing model tracking or batch scoring with real-time serving; MLflow Tracking records experiments but does not serve models.

292
MCQeasy

A data scientist is training a linear regression model using scikit-learn on Databricks. They want to track the model's hyperparameters, such as fit_intercept and normalize, in MLflow. Which MLflow API call should they use to log these hyperparameters?

A.mlflow.log_artifact
B.mlflow.log_param
C.mlflow.log_metric
D.mlflow.set_tag
AnswerB

mlflow.log_param logs a single key-value pair representing a hyperparameter. It is the correct API for recording settings like fit_intercept and normalize. Each call logs one parameter, and parameters are immutable once logged for a run, ensuring a clear record of the configuration used for that training run.

Why this answer

To track hyperparameters in MLflow, the appropriate API is mlflow.log_param, which records key-value pairs that define the model's configuration. This allows the parameters to be visible in the MLflow UI and searchable via the API. Logging metrics, artifacts, or tags would not correctly capture hyperparameters and would hinder experiment comparison.

Exam trap

The trap here is assuming that any logging function can record hyperparameters; only log_param is designed for that purpose.

293
MCQmedium

You are building a pipeline in Databricks and need to ensure that a training job only runs after the upstream data preparation job has successfully completed. Which Databricks feature should you use?

A.Use the mlflow.end_run() command at the end of the data prep script.
B.Use Delta Live Tables (DLT) expectations to trigger the job.
C.Use Databricks Workflows task dependencies.
D.Use a cron schedule with a 30-minute delay for the training job.
AnswerC

Databricks Workflows enables users to build multi-task jobs where tasks are linked by success dependencies. This is the native and most efficient way to ensure that a training task waits for the data preparation task to complete, maintaining a strict and reliable execution order within the pipeline.

Why this answer

Databricks Workflows allows for the creation of complex pipelines using task dependencies. By defining a dependency between the data preparation task and the training task, the orchestrator ensures the correct execution order. This dependency management is foundational for building reliable end-to-end ML pipelines, ensuring that models are always trained on processed, valid data and preventing failures caused by missing or stale input data during the automated training process.

Exam trap

Candidates often try to manage dependencies using custom notebook code or external scheduling tools. They fail to recognize that Databricks Workflows has built-in native support for task dependencies.

294
MCQhard

Refer to the exhibit. A user attempts to transition a model to production, but the code fails with the provided error. What is the most likely cause?

A.The cluster does not have sufficient permissions to read the model.
B.The model has not been registered in the Model Registry.
C.The model version is archived and cannot be transitioned.
D.The model artifact is missing from the underlying DBFS storage.
AnswerB

The error indicates the registry cannot find the entity 'production_model'. This signifies that no model with that specific name exists within the registry. The user must first register the model or ensure they are pointing to the correct registered model name before calling transition operations.

Why this answer

The error indicates that the Model Registry cannot locate the model name provided. In Databricks, models must be registered before they can be transitioned to specific stages like 'Production'. The user likely misspelled the model name or is attempting to reference a model that has not yet been registered within the current workspace environment.

Verifying the Model Registry UI will confirm the correct naming conventions and existing model registrations.

Exam trap

Users often assume that logging a model with mlflow.log_model automatically registers it in the Model Registry. They forget that registration is a separate, explicit step required for lifecycle management.

295
MCQmedium

Refer to the exhibit. A machine learning engineer wants to promote this model to Production. Which MLflow action should be performed to achieve this while ensuring the model is ready for deployment?

A.Use the mlflow.register_model() function with the production flag.
B.Call the transition_model_version_stage API to move the model to Production.
C.Delete the model from Staging and re-upload it to the Production path.
D.Update the tag 'status' to 'Production' in the model metadata.
AnswerB

The transition_model_version_stage API is the standard method for updating the stage of a registered model version. By programmatically changing the stage to 'Production', the model becomes available for production deployment services to fetch and serve the most current approved model artifact for live traffic.

Why this answer

The MLflow Model Registry provides the `transition_model_version_stage` function to promote models between stages like Staging and Production. Promoting a model involves updating its state in the registry, which then allows downstream deployment pipelines to identify the correct model version. This structured approach ensures that only verified models are promoted to production environments, maintaining governance and stability in the model deployment process.

Exam trap

Candidates often confuse manual model logging with registry stage transitions, incorrectly selecting options related to saving files or creating new experiments instead of using the specific API for stage promotion.

296
MCQhard

An ML engineer is configuring a Databricks Job to retrain a model daily. The job must first run a notebook that creates a feature table, then run a notebook that trains and registers the model. The engineer wants to ensure the training notebook only runs if the feature table creation succeeds. Which Databricks Workflows feature should they use to define this dependency?

A.Set the training task's depends_on field to the feature table task.
B.Set the training task's run_if condition to ALL_SUCCESS, which automatically includes the feature table task.
C.Use a conditional task with a run_if condition based on the feature table task's output.
D.Configure the feature table task to call the training notebook at the end of its run.
AnswerA

In Databricks Workflows, each task can specify a list of upstream tasks in its depends_on field. Setting the training task's depends_on to the feature table task ensures the training task runs only after the feature table task completes successfully. This creates a directed acyclic graph (DAG) that enforces the required order and success condition.

Why this answer

In Databricks Workflows, task dependencies are defined using the depends_on field, which lists upstream tasks that must complete successfully before the task runs. This creates a DAG and ensures the training task executes only after the feature table task succeeds. Other options either do not establish the dependency or rely on additional configuration that still requires depends_on.

Exam trap

The trap here is thinking that run_if conditions alone can establish dependencies without explicitly listing upstream tasks in depends_on.

297
MCQmedium

A machine learning engineer has registered a scikit-learn model in Unity Catalog as `prod.ml.risk_model` with version 3. They want to serve it through a Databricks Model Serving endpoint that always uses this exact model version, even after new versions are registered. Which endpoint configuration should they use?

A.Set the served entity to `prod.ml.risk_model` and set the version to `latest` so that the endpoint always uses the most recent registered version.
B.Set the served entity to `prod.ml.risk_model` with version 3 and enable scale-to-zero.
C.Set the served entity to `prod.ml.risk_model` with version 3 and do not configure aliases or the `latest` version.
D.Set the served entity to `prod.ml.risk_model` and rely on the `@champion` alias to always resolve to version 3.
AnswerC

Databricks Model Serving lets you serve a specific registered model version by supplying the model name and version number in the served entity configuration. By specifying version 3 and avoiding aliases or the `latest` marker, the endpoint stays pinned to that immutable version even as newer versions are registered, which directly satisfies the requirement of always serving the same model.

Why this answer

Pinning a Model Serving endpoint to a specific registered model version is done by supplying the model name and version number in the served entity configuration. This produces an immutable reference that does not change when new versions are registered. Relying on aliases or `latest` introduces mutability, which conflicts with the requirement to always serve version 3.

Exam trap

The trap here is assuming that using a model alias such as `@champion` gives the same immutability as a numeric version, when aliases are actually mutable pointers.

298
MCQmedium

A data scientist is using Hyperopt with SparkTrials on a Databricks cluster to tune a scikit-learn model. They set max_evals=100 and parallelism=4. After the tuning completes, they notice that some trials failed due to memory errors on the workers. What is the most likely cause of these failures?

A.The scikit-learn model is being trained on the driver, causing memory pressure on the driver instead of workers.
B.Each trial is training on the full dataset, and the dataset is too large to fit in the memory of a single worker.
C.SparkTrials does not support scikit-learn models and should be used only with MLlib.
D.The cluster's autoscaling is reducing the number of workers, causing trials to be queued and eventually fail.
AnswerB

SparkTrials runs each trial on a single worker, and if the dataset is large, it may exceed the worker's memory. Unlike distributed training, each trial is independent and uses the full dataset unless you subsample or use Spark ML. This leads to out-of-memory errors when the data is too big for one worker.

Why this answer

The correct answer is that each trial is training on the full dataset, and the dataset is too large to fit in the memory of a single worker. SparkTrials distributes trials, but each trial runs on one worker with the full dataset. If the data is large, it can cause out-of-memory errors.

To mitigate, you can reduce the dataset size, increase worker memory, or use distributed algorithms. The other options misattribute the cause to model incompatibility, driver memory, or autoscaling.

Exam trap

The trap here is assuming that SparkTrials distributes the training of a single model across workers, when it actually distributes independent trials, each on a single worker.

299
MCQeasy

A data scientist is working in a Databricks notebook and wants to view the results of their MLflow runs, including metrics and parameters, directly within the notebook. Which MLflow function should they use?

A.mlflow.search_runs()
B.mlflow.get_experiment_by_name()
C.mlflow.get_run()
D.mlflow.list_experiments()
AnswerA

mlflow.search_runs() returns a pandas DataFrame containing run information such as parameters and metrics from the specified experiment. It can be used within a notebook to programmatically inspect and analyze runs. This function is ideal for displaying results directly in the notebook environment, as it provides a structured view of all runs.

Why this answer

mlflow.search_runs() is designed to query runs within an experiment and return a pandas DataFrame with columns for run ID, parameters, metrics, and other metadata. This makes it straightforward to display and analyze multiple runs in a notebook. Other functions either retrieve single runs or list experiments without providing run-level details in a tabular format.

Exam trap

The trap here is confusing functions that list experiments or retrieve single runs with the one that returns a comprehensive table of runs for analysis.

300
MCQmedium

A machine learning engineer is using MLflow to log a model built with XGBoost. They call mlflow.xgboost.log_model(xgb_model, 'model') and then attempt to load the model in a different environment using mlflow.pyfunc.load_model('runs:/<run_id>/model'). The load fails with an error about missing dependencies. Which action should they take to ensure the model can be loaded in the new environment?

A.They should log the model with the registered_model_name parameter to ensure dependencies are captured.
B.They should save the model in the ONNX format instead, because ONNX models have no dependencies.
C.They should include the XGBoost library in the conda environment when logging the model, either by passing a custom conda_env or by ensuring the library is installed in the current environment so MLflow can infer it.
D.They should use mlflow.xgboost.load_model() instead of mlflow.pyfunc.load_model(), because the latter does not support XGBoost models.
AnswerC

This is correct because MLflow captures dependencies in a conda.yaml file when logging a model. If XGBoost is not included, loading in a new environment will fail. By default, MLflow infers dependencies from the current environment, but if XGBoost was not installed or not detected, it may be missing. Providing a custom conda_env or ensuring XGBoost is installed during logging ensures the dependency is recorded.

Why this answer

When logging a model with MLflow, dependencies are recorded in a conda environment file. If a required library like XGBoost is missing from that file, loading in a new environment fails. Ensuring the library is installed during logging allows MLflow to capture it, or you can specify a custom conda environment.

This guarantees the model can be reproduced.

Exam trap

The trap here is assuming that model registration or using a native loader solves dependency issues, when the real fix is to include the dependency in the logged environment.

Page 3

Page 4 of 5

Page 5

All pages

Practice Databricks-ML-Assoc by domain

Target a specific domain to shore up weak areas.

See all domains with question counts →