Courseiva
Describe an analytics workload on AzurehardMultiple ChoiceObjective-mapped

DP-900 Describe an analytics workload on Azure Practice Question

Your company uses Azure Databricks to process streaming data from Event Hubs. The data is transformed and written to Azure Data Lake Storage Gen2 as Delta tables. You notice that some records are duplicated in the Delta tables. Which configuration change should you make to prevent duplicates?

⚠ Common exam trap

Watch out — candidates often confuse idempotent writes (which prevent duplicate writes within a single transaction) with checkpointing (which prevents duplicate reads across query restarts), leading them to choose Option C instead of B.

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

Enable checkpointing in the streaming query to store progress.

Checkpointing in Spark Structured Streaming stores the offset of the last processed event from Event Hubs. When the query restarts, it reads from the checkpointed offset, ensuring each event is processed exactly once and preventing duplicates in the Delta table.

Answer analysis

Option-by-option breakdown

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

  • Add a separate job to deduplicate the Delta table.

    Why it's wrong here

    Running a separate batch job to deduplicate the Delta table adds significant latency because it must scan and rewrite large volumes of data after the fact. It also requires you to define and maintain a separate deduplication state, which is complex and error-prone in a streaming pipeline. Most importantly, it cannot prevent duplicate data from being committed in the first place, so any downstream consumers that read the table before the cleanup job runs will still see duplicates. This approach is a post-processing workaround, not a reliable streaming correctness mechanism.

  • Enable checkpointing in the streaming query to store progress.

    Why this is correct

    Checkpointing in the streaming query is the correct mechanism because Structured Streaming uses a checkpoint location to persist the committed offsets and the current state of the query. When a failure occurs, the query restarts from the last committed offset, ensuring that no data is reprocessed and no data is lost—this is what enables exactly-once processing semantics. Without checkpointing, the query has no record of what has already been consumed, so it may reprocess the same input data after a restart, causing duplicates in the Delta table. In Azure Databricks, checkpointing is configured via the `checkpointLocation` option and is essential for reliable streaming.

  • Use Delta Lake's idempotent write support.

    Why it's wrong here

    Delta Lake's idempotent write support, such as using a `unique_key` or idempotent transaction IDs, does help avoid duplicate records when a write operation is retried, but it is not a substitute for checkpointing. Idempotent writes only guard against duplicate writes of the same micro-batch; they do not track source offsets or provide recovery knowledge about which data has already been read. If the streaming source is re-read due to lack of checkpointing, the entire micro-batch—including new and old records—is reprocessed, and idempotent writes may not recognize all records as seen if no deduplication key is defined. Therefore, idempotent writes are a useful complement to checkpointing, but they do not address the root cause of duplicate reads.

  • Increase the batch interval in the streaming query.

    Why it's wrong here

    Increasing the batch interval in the streaming query reduces the frequency of micro-batches, but it does not eliminate duplicates because the root cause is the absence of checkpointing, not the batch size. A longer interval means less frequent writes, but if a failure occurs between reading from the source and committing the results, the same data can still be reprocessed in the next batch. The streaming engine relies on offsets and checkpoint metadata to know exactly what has been processed; merely changing the timing of micro-batches does not provide that metadata. In fact, longer batch intervals can increase latency and memory pressure while leaving exactly-once guarantees unaddressed.

About these practice questions

This DP-900 question is part of Courseiva's 820-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 by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DP-900 practice question is part of Courseiva's free Microsoft 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 DP-900 exam.