Databricks-Spark-Assoc Structured Streaming Practice Question
Which state management strategy should you implement if you notice your streaming aggregation query is failing due to excessive memory consumption on the executor nodes?
⚠ Common exam trap
Candidates often try to increase executor memory or change the shuffle partition count, ignoring the root cause: the state store is growing indefinitely due to missing or loose watermarks.
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
✓
Implement or tighten the watermark duration.
Aggregations in streaming inherently require state management. If memory is exhausted, it is often due to the state store growing too large because of late data or a lack of proper watermark cleanup. Implementing a stricter watermark and periodically cleaning the state using stateful operators like 'dropDuplicates' or correctly configured windowing is necessary. This ensures the cluster stays within its memory limits during long-term operation.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Increase the checkpoint interval.
Why it's wrong here
Increasing the checkpoint interval affects how often state is persisted to reliable storage, but it does not reduce the memory footprint required to keep state active in the executor heap. In fact, it might increase the duration between saves, potentially making recovery slower without solving the memory issue.
- ✓
Implement or tighten the watermark duration.
Why this is correct
Tightening the watermark duration instructs Spark to discard state for old data sooner. This directly reduces the memory footprint of the state store, as the engine no longer needs to track windows that have already 'expired' according to the watermark, which is the most effective way to address memory pressure.
- ✗
Disable checkpointing to free memory.
Why it's wrong here
Disabling checkpointing will make the streaming query non-fault-tolerant and, more importantly, will not help with memory consumption. Checkpointing occurs on storage, while the state itself lives in the executor's memory. This action would simply prevent the query from recovering after a failure without resolving the core memory issue.
- ✗
Use a larger instance type for all nodes.
Why it's wrong here
While scaling up to larger instances provides more memory, it is a reactive and costly fix that ignores the underlying problem. A well-designed streaming query should manage its state memory efficiently. Addressing the watermark logic is a more architectural and scalable approach to ensuring system stability under heavy loads.
About these practice questions
One of 295 original Databricks-Spark-Assoc practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.