Courseiva

Databricks-ML-Assoc Databricks Machine Learning Practice Question

A machine learning engineer registers a model in the Databricks Model Registry and wants to serve it with low-latency online inference. The model's Python dependencies include a custom private library that is not publicly available. Which deployment approach should the engineer use to ensure the private library is available at inference time?

⚠ Common exam trap

The trap here is assuming that model serving can dynamically fetch private code from DBFS or environment variables, when in reality dependencies must be baked into the environment at build time.

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

✓

Package the private library as a wheel file, include it in the model's conda environment or requirements, and log the model with that dependency so the serving endpoint installs it.

To serve a model with a private dependency, the dependency must be included in the model's environment specification. Packaging the private library as a wheel file and referencing it in the conda environment or requirements ensures the serving endpoint installs it during environment construction, so the model can import it at inference time.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Deploy the model to a Databricks model serving endpoint and specify the private library as an environment variable in the endpoint configuration.

    Why it's wrong here

    Model serving endpoints do not install Python packages from environment variables. Dependencies must be provided through a supported mechanism such as a requirements file, a custom environment, or a wheel file included in the model artifact. Setting an environment variable would not make the private library importable at runtime.

  • ✗

    Register the model with mlflow.pyfunc.log_model and set the pip_requirements parameter to the name of the private library as published on PyPI.

    Why it's wrong here

    A private library is not published on PyPI, so specifying its PyPI name would cause the serving environment build to fail when it attempts to resolve the package. The private library must be made available as a local wheel file or through a private package index that the serving environment can access.

  • ✗

    Upload the private library to DBFS and reference its path in the model's Python code using dbutils.fs, then rely on the serving endpoint to mount DBFS automatically.

    Why it's wrong here

    Model serving endpoints do not automatically mount DBFS into the inference container, and dbutils is not available in the serving environment. Referencing a DBFS path at runtime would fail because the container lacks both the mount and the dbutils library. Dependencies must be installed into the environment before the model is loaded.

  • ✓

    Package the private library as a wheel file, include it in the model's conda environment or requirements, and log the model with that dependency so the serving endpoint installs it.

    Why this is correct

    Databricks model serving builds the inference environment from the logged model's declared dependencies, such as a conda.yaml or requirements.txt. Including the private library as a wheel file in the model artifact and referencing it in the environment allows the endpoint to install it during container build, making it available to the model's predict function.

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.