Databricks-Spark-Assoc Structured Streaming Practice Question
A developer is building a Structured Streaming job that reads from a Kafka topic and writes to a Delta table. The job must handle late data up to 15 minutes and ensure that aggregations are updated correctly. The developer adds a watermark of 15 minutes on the event time column. What is the effect of this watermark on the aggregation state and output?
⚠ Common exam trap
The trap here is thinking that a watermark immediately drops state or deduplicates data, when it actually only defines a delay threshold for late data and state cleanup based on event time.
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
✓
The watermark allows the engine to drop state for windows that are older than the watermark, and late data within 15 minutes is still processed and can update the aggregation.
A watermark in Structured Streaming defines a threshold for how late data can arrive. It allows the engine to drop old state once the watermark passes the window end time, preventing unbounded state growth. Late data within the watermark delay is still processed and can update aggregations. This balances correctness and resource usage, enabling efficient handling of late-arriving events in streaming aggregations.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The watermark ensures exactly-once processing by deduplicating records that arrive within the 15-minute window.
Why it's wrong here
A watermark does not deduplicate records. Exactly-once processing is achieved through checkpointing and idempotent sinks, not watermarks. The watermark only manages state and late data; it does not prevent duplicate records from being processed if they appear in the source. Deduplication would require additional logic, such as dropDuplicates, which is separate from watermarking.
- ✓
The watermark allows the engine to drop state for windows that are older than the watermark, and late data within 15 minutes is still processed and can update the aggregation.
Why this is correct
The watermark specifies how long the engine waits for late data. State for a window is kept until the watermark (max event time seen minus 15 minutes) passes the window's end time. Data arriving within the 15-minute delay is still processed and can update the aggregation. After the watermark passes, state is dropped and further late data is ignored. This is the intended behavior for handling late data.
- ✗
The watermark forces the output mode to complete, so the entire aggregation result is recomputed on every trigger.
Why it's wrong here
The watermark does not force the output mode to complete. Output mode is chosen independently. With a watermark, you can still use update or append mode. Complete mode would recompute the entire result, but that is not a requirement of using a watermark. The watermark's purpose is to bound state and handle late data, not to dictate the output mode.
- ✗
The watermark causes the aggregation state to be dropped immediately after 15 minutes, and any late data beyond that is ignored.
Why it's wrong here
The watermark does not drop state immediately after 15 minutes; it defines a threshold for late data. State for a given window is retained until the watermark passes the window's end time plus the watermark delay. Data arriving after the watermark is considered too late and is dropped, but state is not dropped exactly at 15 minutes; it depends on the window boundaries and the watermark progression.
About these practice questions
Courseiva writes every Databricks-Spark-Assoc question from scratch — 295 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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-Spark-Assoc 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-Spark-Assoc exam.