Home / DE Associate practice test / Data Transformation and Modeling / Question

Databricks Data Engineer Associate · free practice question

A Lakeflow declarative pipeline consumes a CDC feed of inserts, updates, and deletes keyed by customer_id, and events sometimes arrive out of order. The target…

Exam-style question on Data Transformation and Modeling from the free DE Associate practice test, with the answer and a full explanation below.

Updated November 10, 2026

Data Transformation and Modeling

A Lakeflow declarative pipeline consumes a CDC feed of inserts, updates, and deletes keyed by customer_id, and events sometimes arrive out of order. The target table must always reflect the latest state per key. Which approach correctly applies the changes?

  1. ADeclare the target with AUTO CDC (APPLY CHANGES INTO), with KEYS (customer_id) and SEQUENCE BY the ordering column, to upsert and delete by key in order.
  2. BWrite a foreachBatch function that runs MERGE INTO against the target for each micro-batch, as declarative pipelines lack a keyed upsert construct.
  3. CDefine the target as a streaming table that appends each CDC event as it arrives, and let consumers read the latest row per key at query time.
  4. DRebuild the target with CREATE OR REPLACE from the full change feed on each pipeline update, which resolves out-of-order events on each run.
  5. EUse AUTO CDC (APPLY CHANGES INTO) with KEYS (customer_id) and omit the SEQUENCE BY clause, letting arrival order decide which update wins per key.
Answer & explanation

Correct answer: A

WHY A: AUTO CDC / APPLY CHANGES INTO applies inserts, updates, and deletes by KEYS and uses SEQUENCE BY to order events, so out-of-order changes resolve to the latest state per key automatically.

WHY NOT B: A declarative pipeline supports keyed upserts natively via AUTO CDC / APPLY CHANGES INTO, so hand-written foreachBatch MERGE code is unnecessary.

WHY NOT C: Appending every CDC event to a streaming table keeps duplicates and deletes as rows rather than maintaining the current state per key in the target.

WHY NOT D: CREATE OR REPLACE overwrites the target and is expensive, and it discards history rather than applying changes incrementally.

WHY NOT E: Omitting SEQUENCE BY relies on arrival order, so an out-of-order event can apply an older update over a newer one.

Take the full DE Associate practice test free →

Would you pass today?

This question is one of 45 in the free, timed Databricks Data Engineer Associate practice test. Take it and get a section-by-section score.

Start the free test →