Courseiva

Databricks-DE-Pro Developing Code (Python/SQL) Practice Question

A Data Engineer is building a Structured Streaming pipeline that reads from a Kafka topic and writes to a Delta table. The pipeline must handle late-arriving data up to 2 hours and produce correct aggregations per 10-minute window. The engineer wants the streaming query to automatically clean up old state so the job does not accumulate unbounded state. Which combination of Structured Streaming features should be used?

⚠ Common exam trap

It's easy for candidates to confuse window duration with watermark duration or using processing time instead of event time, which would either drop valid late data or fail to clean up state correctly.

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

✓

Use a tumbling window of 10 minutes with a watermark of 2 hours on the event-time column, and set the output mode to append.

To handle late data up to 2 hours while producing 10-minute aggregations and bounded state, the pipeline needs event-time tumbling windows of 10 minutes and a watermark of 2 hours. Append mode emits a window result only after the watermark exceeds the window end, and Spark automatically evicts state older than the watermark, keeping state size proportional to the lateness bound rather than the entire stream history.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Use a tumbling window of 10 minutes with a watermark of 2 hours on the event-time column, and set the output mode to append.

    Why this is correct

    A watermark of 2 hours allows late data up to that bound, and tumbling windows of 10 minutes produce per-window aggregates. Append mode emits a window result only after the watermark passes the window end, and Spark automatically drops state older than the watermark, preventing unbounded state growth.

  • ✗

    Use a sliding window of 10 minutes with a watermark of 10 minutes on the event-time column, and set the output mode to update.

    Why it's wrong here

    A 10-minute watermark would drop late data arriving more than 10 minutes after the window end, violating the 2-hour late-data requirement. Also, a sliding window with 10-minute duration and a 10-minute slide behaves like a tumbling window but the watermark is insufficient. Update mode does not by itself guarantee state cleanup based on the required lateness.

  • ✗

    Use a tumbling window of 10 minutes with a watermark of 2 hours on the processing-time column, and set the output mode to append.

    Why it's wrong here

    Watermarking on processing time does not account for event-time lateness; late-arriving events with old event timestamps would be handled incorrectly. The watermark must be on the event-time column to bound how late data can arrive relative to the window. Using processing time defeats the purpose of handling late data based on event time.

  • ✗

    Use a tumbling window of 2 hours with a watermark of 10 minutes on the event-time column, and set the output mode to complete.

    Why it's wrong here

    A 2-hour window does not produce 10-minute aggregations, and a 10-minute watermark is too short for 2-hour late data. Complete mode retains all state indefinitely and recomputes the entire result table, which conflicts with the goal of bounded state and is generally not suitable for streaming aggregation to Delta.

About these practice questions

This Databricks-DE-Pro question is part of Courseiva's 267-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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-DE-Pro 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-DE-Pro exam.