Courseiva

Databricks-DE-Pro Developing Code (Python/SQL) Practice Question

You are migrating a legacy ETL process to Delta Live Tables (DLT). You have an existing table defined with a complex transformation that involves a custom Python function using a third-party library. How should you structure this in DLT to ensure the function is available and correctly applied?

⚠ Common exam trap

Candidates often place custom logic inside the dlt.table function definition. This causes issues with function serialization and prevents the DLT engine from correctly capturing the transformation logic during the pipeline initialization phase.

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

✓

Define the function inside the same notebook but outside the 'dlt.table' function.

DLT pipelines require explicit management of dependencies. Using the 'dlt.table' decorator alongside proper library installation via cluster configuration or pip requirements ensures that Python functions are serialized and distributed to worker nodes. Understanding how DLT handles dependencies and decorators is critical for building reliable, production-grade pipelines that maintain parity with legacy logic while leveraging the automatic orchestration and quality management features inherent in the DLT framework.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Define the function inside the same notebook but outside the 'dlt.table' function.

    Why this is correct

    Defining the function in the same module ensures it is accessible during the execution of the DLT pipeline. The decorator will register the function as part of the materialization process, allowing DLT to call it while processing data, provided that any necessary external libraries are also installed.

  • ✗

    Hardcode the library path using 'sys.path.append'.

    Why it's wrong here

    Hardcoding paths is brittle and prone to failure when the pipeline runs on different nodes in a managed cluster environment. DLT expects dependencies to be handled via standard Python environment management or cluster library settings to ensure portability and stability across all worker nodes in the pipeline.

  • ✗

    You cannot use custom Python functions in DLT.

    Why it's wrong here

    DLT supports arbitrary Python code, including custom UDFs and libraries. The framework is designed to handle complex transformations, provided the code is structured correctly using the appropriate DLT decorators and that any external requirements are managed through the pipeline's runtime configuration or cluster library settings.

  • ✗

    Use the 'spark.udf.register' method globally.

    Why it's wrong here

    While global UDF registration works in standard Spark jobs, it is not the recommended pattern for DLT. DLT expects a more declarative style where functions are passed directly into the table definitions, ensuring that the pipeline can maintain lineage and manage the materialization lifecycle of the tables.

Quick reference

RAID Level Comparison

RAID LevelMin DisksFault ToleranceReadWriteUsable Capacity
RAID 02NoneExcellentExcellent100%
RAID 121 diskGoodModerate50%
RAID 531 diskGoodModerate67–94%
RAID 642 disksGoodLower50–88%
RAID 1041 disk per mirrorExcellentGood50%

RAID is not a backup strategy — it protects against disk failure but not against accidental deletion, ransomware, or site-level events.

About these practice questions

This Databricks-DE-Pro question is part of Courseiva's 267-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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-DE-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-DE-Pro exam.