Databricks-ML-Pro ML Ops Practice Question
A data scientist has trained a model and logged it with MLflow. They now need to deploy it as a real-time endpoint on Databricks Model Serving. The model requires a custom Python library that is not available in the default environment. What is the correct way to ensure the library is available when serving the model?
⚠ Common exam trap
The trap here is assuming that Model Serving endpoints run on clusters you can configure, but they are serverless and dependencies must be declared in the model artifact.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Include the library in the model's conda environment or requirements file when logging the model with MLflow.
The correct way is to include the custom library in the model's conda environment or requirements file when logging with MLflow. Databricks Model Serving uses this specification to build the serving environment, ensuring the library is available. Other methods like cluster-level installations or runtime scripts do not apply to serverless serving endpoints and can introduce reliability issues.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Install the library on the driver node of the cluster used for serving, and restart the cluster.
Why it's wrong here
Model Serving endpoints run on serverless infrastructure managed by Databricks, not on user-managed clusters. Installing libraries on a cluster driver does not affect the serving environment. The correct approach is to specify dependencies in the model's environment, such as a conda environment or requirements file, which Model Serving will use to build the serving image.
- ✗
Use a custom container image for the model endpoint and install the library at runtime via a startup script.
Why it's wrong here
While custom containers are supported for Model Serving, installing libraries at runtime via a startup script is not recommended because it increases cold start latency and can fail if the script errors. It is better to bake dependencies into the image or specify them via MLflow's environment. The simplest and most reliable method is to declare dependencies when logging the model.
- ✗
Add the library to the Databricks workspace's global init script so it is available to all clusters.
Why it's wrong here
Global init scripts apply to clusters, not to Model Serving endpoints, which are serverless. They do not influence the serving environment. Moreover, global init scripts can have unintended consequences and are not recommended for managing model-specific dependencies. The correct method is to declare dependencies in the model artifact.
- ✓
Include the library in the model's conda environment or requirements file when logging the model with MLflow.
Why this is correct
When logging a model with MLflow, you can specify a conda environment or a requirements file that lists all dependencies. Databricks Model Serving uses this information to create the serving environment, ensuring the custom library is installed. This is the standard and supported method for managing model dependencies in serving.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
About these practice questions
One of 300 original Databricks-ML-Pro practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Databricks exam blueprint
This Databricks-ML-Pro practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-ML-Pro exam.