Databricks Data Engineer Professional · 12% practice allocation

Databricks Data Engineer Professional: Data Manipulation Practice Questions

5 free sample questions from the Data Manipulation domain, with answers and explanations. The full Data Engineer Professional bank has 437 questions across 9 domains. Questions are scenario-based and written from the official Databricks exam guide.

1.

A data engineer defines the following DLT pipeline table:

@dlt.table
@dlt.expect_or_fail("non_negative_amount", "amount >= 0")
def validated_transactions():
    return dlt.read("raw_transactions")

During a pipeline run, 3 records arrive with amount = -5. What happens?

  • A. The 3 records are written to the output table with a _violated_expectations metadata column.
  • B. The 3 invalid records are quarantined into a separate DLT quarantine table.
  • C. The pipeline completes successfully but logs the 3 violations as warnings in the DLT event log.
  • D. The entire pipeline update fails immediately when the first invalid record is encountered.✓ Correct
  • E. The 3 invalid records are silently dropped and the pipeline continues normally.
Explanation

expect_or_fail stops the update as soon as a record violates the constraint, so the pipeline fails and invalid data does not reach the target. A plain expect keeps the rows and records warnings, and expect_or_drop removes them and continues. No violation metadata column or quarantine table is created automatically. This code uses the legacy dlt module; current Lakeflow Spark Declarative Pipelines code uses from pyspark import pipelines as dp, with dp.table or dp.materialized_view and spark.read.table().

2.

A data engineer wants to understand all changes made to a production Delta Lake table named orders over the past week, including who ran each operation and what type of operation it was. Which command should the data engineer run?

  • A. SELECT * FROM orders WHERE _commit_timestamp >= current_date() - INTERVAL 7 DAYS
  • B. DESCRIBE DETAIL orders
  • C. SELECT * FROM delta./path/to/orders/_delta_log
  • D. DESCRIBE HISTORY orders✓ Correct
  • E. SHOW TBLPROPERTIES orders
Explanation

DESCRIBE HISTORY orders returns the full audit log of all operations performed on the Delta Lake table, including operation type, timestamp, user, and notebook/job details. DESCRIBE DETAIL returns current metadata (file count, size, schema) but not historical operations. SHOW TBLPROPERTIES lists table configuration properties, not operation history. Querying _commit_timestamp on the base table does not exist as a built-in column. Directly querying the _delta_log path returns raw JSON transaction log files and is not the intended interface.

3.

A production Delta Lake table receives continuous CDC updates. The data engineering team wants to keep the table commit history for 60 days for auditing, needs time travel only for the last 7 days, and wants the physical data files backing deleted records to be eligible for cleanup after 7 days to control storage costs. Which table properties should they configure?

  • A. SET TBLPROPERTIES ('delta.logRetentionDuration' = 'interval 60 days', 'delta.deletedFileRetentionDuration' = 'interval 7 days')✓ Correct
  • B. SET TBLPROPERTIES ('delta.logRetentionDuration' = 'interval 7 days', 'delta.deletedFileRetentionDuration' = 'interval 60 days')
  • C. SET TBLPROPERTIES ('delta.dataRetentionDuration' = 'interval 60 days', 'delta.vacuumRetentionDuration' = 'interval 7 days')
  • D. SET TBLPROPERTIES ('delta.logRetentionDuration' = 'interval 60 days', 'delta.deletedFileRetentionDuration' = 'interval 60 days')
Explanation

delta.logRetentionDuration keeps the transaction log, and so the commit history, for the stated period; 60 days meets the auditing need. delta.deletedFileRetentionDuration sets how long unreferenced data files are protected from VACUUM; 7 days makes them eligible for cleanup after a week. Time travel needs both log and data files, so it is limited to the 7-day file window. Swapping the two values loses history and keeps files too long. The dataRetentionDuration and vacuumRetentionDuration properties do not exist. Setting both to 60 days would keep deleted files far longer than required.

4.

A CDC source must be applied to a target so the target reflects the latest state per key, handling inserts, updates, and deletes with correct ordering. Which DLT capability handles this declaratively?

  • A. APPLY CHANGES INTO / AUTO CDC INTO (with a sequence-by column)✓ Correct
  • B. A materialized view that selects every change row from the source
  • C. A streaming table with an append flow and a watermark
  • D. An expect_or_drop expectation on the operation column
Explanation

Change data capture in Lakeflow Spark Declarative Pipelines (formerly DLT) is declared with AUTO CDC ... INTO, previously named APPLY CHANGES INTO. It uses keys and a sequence column to apply inserts, updates, and deletes in the right order, as SCD Type 1 or Type 2. A materialized view over the change rows exposes every event rather than the latest state per key. An append flow with a watermark only adds rows. An expectation filters rows by a condition and cannot update or delete existing ones.

5.

A data engineering team is building a high-throughput Structured Streaming pipeline that reads from a Delta Lake table using readStream. They want to limit the number of files processed per micro-batch to avoid overwhelming downstream systems. Which TWO options correctly limit the processing rate in this context? (Select TWO)

  • A. Set spark.sql.streaming.maxBatchSize = 10 in the Spark configuration to globally cap the number of records per batch.
  • B. Set option("readChangeFeed", "true") to enable incremental reads that automatically throttle ingestion rate.
  • C. Set option("maxFilesPerTrigger", 10) on the readStream call to process at most 10 new Delta Lake files per micro-batch.✓ Correct
  • D. Use Trigger.AvailableNow() to process all available files in a single micro-batch and then stop the query.
  • E. Set option("maxBytesPerTrigger", "100m") on the readStream call to process at most 100 MB of new data per micro-batch (soft limit).✓ Correct
Explanation

The Delta streaming source offers two rate limits: maxFilesPerTrigger caps how many new files each micro-batch reads, and maxBytesPerTrigger sets a soft cap on the amount of data per micro-batch. There is no spark.sql.streaming.maxBatchSize setting. Trigger.AvailableNow() processes everything currently available, possibly over several micro-batches, and then stops; it is not a rate limit by itself. Reading the change data feed changes what is returned, not how quickly it is ingested.

Test yourself across every Data Engineer Professional domain

The free Data Engineer Professional practice test mixes about 20 questions weighted like the exam. The full 437-question bank adds instant grading, flashcards and a timed mock exam.

Study this domain

Data Manipulation study guide (Data Engineer Professional) →

Other Data Engineer Professional domains

← All Databricks Data Engineer Professional study resources