Courseiva
Model Deployment →easyMultiple Choice

Databricks-ML-Assoc Model Deployment Practice Question

A data scientist has a custom Python model wrapped in an MLflow pyfunc flavor and needs to serve it on Databricks Model Serving. The model's preprocessing requires a library that is not part of the default serving environment. What is the correct way to make that dependency available to the endpoint?

⚠ Common exam trap

The trap here is assuming the serving environment inherits packages from the cluster that trained the model, when the endpoint instead rebuilds dependencies solely from what was recorded with the logged model.

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

✓

Log the model with the required library listed in the model's conda environment or pip requirements so it is captured in the model artifact.

Model Serving reconstructs the runtime environment from the dependency specification stored with the logged model. To bring in a library beyond the default environment, the dependency must be captured in the model's conda environment or pip requirements when the model is logged, which guarantees the endpoint installs it reproducibly. Cluster-level installs and storage paths do not reach the serving container.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Upload the library wheel to DBFS and reference its path in the endpoint's environment variables.

    Why it's wrong here

    Environment variables configure runtime behavior such as credentials or feature flags; they do not install Python packages. Uploading a wheel to DBFS does not make it importable inside the serving container, and there is no supported environment-variable mechanism to add packages. Dependencies must be declared with the model at logging time.

  • ✓

    Log the model with the required library listed in the model's conda environment or pip requirements so it is captured in the model artifact.

    Why this is correct

    MLflow records dependencies when the model is logged, and Model Serving rebuilds the environment from those captured requirements. Adding the library to the model's conda environment or pip requirements at log time ensures the endpoint installs it during container build. This is the supported, reproducible mechanism for custom dependencies in served models.

  • ✗

    Add the library as a cluster library on the all-purpose cluster where the model was trained.

    Why it's wrong here

    Cluster libraries affect notebook and job execution on that cluster, not the container that Model Serving constructs for an endpoint. The serving environment is derived from the logged model's dependency specification, so a cluster library attachment has no bearing on whether the library is present when the endpoint loads and runs the model.

  • ✗

    Install the library interactively on the driver node before creating the endpoint.

    Why it's wrong here

    Model Serving builds an isolated container per served entity from the model's declared dependencies; it does not inherit packages installed on a cluster driver. An interactive install on the driver is ephemeral and invisible to the serving infrastructure, so the endpoint would still fail to import the library at inference time.

About these practice questions

One of 319 original Databricks-ML-Assoc 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 →

How Courseiva writes practice questions · Editorial policy

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-Assoc 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-Assoc exam.