Sample question 1 — Databricks Lakehouse Platform
Marketers want each incoming micro-batch of orders written to a vendor endpoint with a bespoke authentication handshake, and the writer must also record an idempotency key so a repeated batch is not submitted twice. A plain Delta output cannot express that handshake. Which streaming write pattern supports the bespoke call?
- A. Land the orders into a Delta table and notify the vendor.
- B. Raise the batch size so fewer handshakes are needed.
- C. Store the idempotency key in a Delta table first.
- D. Use foreachBatch for the custom per-microbatch write.
Answer: D. Option D is correct because the foreachBatch sink receives each incoming microbatch as a DataFrame, so custom Python logic can run the vendor handshake and write the rows before that microbatch finishes. Option A is incorrect because landing the payload first and telling the endpoint afterwards never performs the handshake. Option B changes how much data each call carries but keeps the plain Delta writer. Option C only persists the key, so nothing reaches the endpoint.
