databricks Data Engineer Professional · Practice questions

Section 1: Developing Code for Data Processing Using Python and SQL Practice Questions

Review 10 sample questions with their correct answers and explanations. Sign up free to continue with the full topic quiz.

Sign up free for the full quiz

Question 1

Which statement about the Delta transaction log checkpoint is correct?

  1. It is created only when VACUUM runs
  2. It stores a full copy of the table's data
  3. It is the streaming checkpoint used by Structured Streaming
  4. It summarizes table state so readers need not replay all JSON commits — Correct

Correct answer

It summarizes table state so readers need not replay all JSON commits

Explanation

Delta writes Parquet checkpoints periodically to speed up state reconstruction.

Question 2

Which statement about SQL stored procedures or SQL scripting on Databricks is correct?

  1. SQL scripting cannot run in jobs
  2. SQL scripting supports control flow such as loops and conditions in SQL — Correct
  3. SQL scripting replaces Unity Catalog permissions
  4. SQL scripting is only available in Python notebooks

Correct answer

SQL scripting supports control flow such as loops and conditions in SQL

Explanation

SQL scripting adds procedural constructs to Databricks SQL.

Question 3

A streaming aggregation counts events per device per 5-minute window. Late events up to 10 minutes must be included, and state must not grow without bound. Which code is correct?

  1. df.withWatermark('ingest_ts', '0 seconds').groupBy('device_id').count()
  2. df.groupBy('device_id').count()
  3. df.groupBy(window('event_ts', '5 minutes'), 'device_id').count().withWatermark('event_ts', '10 minutes')
  4. df.withWatermark('event_ts', '10 minutes').groupBy(window('event_ts', '5 minutes'), 'device_id').count() — Correct

Correct answer

df.withWatermark('event_ts', '10 minutes').groupBy(window('event_ts', '5 minutes'), 'device_id').count()

Explanation

The watermark must be defined on the event-time column before the aggregation to bound state and handle lateness.

Question 4

Which Python feature in declarative pipelines writes a one-time backfill into a streaming table alongside its ongoing streaming flow?

  1. An append flow with once=True — Correct
  2. A view with persist=True
  3. A second pipeline writing to the same table without coordination
  4. A materialized view with full refresh scheduled every minute

Correct answer

An append flow with once=True

Explanation

Once flows run a single time and can backfill historical data into a target.

Question 5

Two concurrent jobs run MERGE statements on the same Delta table, touching different date ranges. One fails with ConcurrentAppendException. Which change most directly reduces conflicts?

  1. Run VACUUM before each MERGE
  2. Increase spark.sql.shuffle.partitions
  3. Disable the Delta transaction log
  4. Add explicit date predicates to each MERGE condition — Correct

Correct answer

Add explicit date predicates to each MERGE condition

Explanation

Explicit predicates let Delta detect that operations touch disjoint data; row-level concurrency further reduces conflicts.

Question 6

Which statement about Lakeflow declarative pipelines in continuous mode versus triggered mode is correct?

  1. Triggered mode always has lower latency
  2. Both modes stop after each update
  3. Continuous runs constantly for low latency; triggered stops — Correct
  4. Continuous mode cannot process streaming tables

Correct answer

Continuous runs constantly for low latency; triggered stops

Explanation

Choose continuous for latency-sensitive workloads and triggered for cost-efficient periodic processing.

Question 7

A pipeline update fails with a schema change in the source. The table uses AUTO CDC. Which statement is correct?

  1. The pipeline converts the table to SCD Type 2 automatically
  2. Supported schema changes can propagate; incompatible ones may need a full refresh — Correct
  3. AUTO CDC never allows any schema change, so the table must be dropped
  4. Schema changes are ignored silently and new columns are never added

Correct answer

Supported schema changes can propagate; incompatible ones may need a full refresh

Explanation

Additive changes typically evolve; breaking changes may require reprocessing.

Question 8

Which statement about the trade-off between triggered and continuous pipelines is correct?

  1. Triggered is always lower latency
  2. Continuous lowers latency but costs more compute; triggered is cheaper for looser freshness — Correct
  3. There is no trade-off
  4. Continuous pipelines are cheaper because they process less data in each micro-batch and shut down when idle

Correct answer

Continuous lowers latency but costs more compute; triggered is cheaper for looser freshness

Explanation

Choose based on freshness requirements versus cost.

Question 9

Which statement about the Python API for Lakeflow declarative pipelines is correct?

  1. Python pipelines cannot read streaming sources
  2. Expectations are only available in SQL
  3. Decorated functions return DataFrames that define datasets — Correct
  4. Pipelines must call spark.write in each function

Correct answer

Decorated functions return DataFrames that define datasets

Explanation

Python pipelines define datasets with decorators and return DataFrames; the framework handles writing and orchestration.

Question 10

Which statement about row-level concurrency in Delta is correct?

  1. It disables optimistic concurrency control
  2. It allows two writers to update the same row with both changes kept
  3. It only applies to append-only tables
  4. It resolves conflicts at row level for concurrent writes — Correct

Correct answer

It resolves conflicts at row level for concurrent writes

Explanation

Row-level concurrency detects conflicts at the row level, so concurrent UPDATE, DELETE and MERGE on different rows can succeed.

Ready for the full quiz?

Create a free QuizAnalyst account to practice the complete question set and save your progress.

Sign up free for the full quiz