Sample questions with answers and explanations
Question 1
Which statement about the Delta transaction log checkpoint is correct?
- It is created only when VACUUM runs
- It stores a full copy of the table's data
- It is the streaming checkpoint used by Structured Streaming
- 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?
- SQL scripting cannot run in jobs
- SQL scripting supports control flow such as loops and conditions in SQL — Correct
- SQL scripting replaces Unity Catalog permissions
- 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?
- df.withWatermark('ingest_ts', '0 seconds').groupBy('device_id').count()
- df.groupBy('device_id').count()
- df.groupBy(window('event_ts', '5 minutes'), 'device_id').count().withWatermark('event_ts', '10 minutes')
- 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?
- An append flow with once=True — Correct
- A view with persist=True
- A second pipeline writing to the same table without coordination
- 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?
- Run VACUUM before each MERGE
- Increase spark.sql.shuffle.partitions
- Disable the Delta transaction log
- 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.