Skip to content

Real Databricks scenarios for your team

77 situations that happen on Databricks, each with three ways to handle it and the best call explained from the docs. Use them to screen a candidate, or to run a thirty-minute session where the team argues over a real problem before anyone reads the answer. Free, and no sign-up for you or them.

Screen a candidate

Send the link before a call. It opens a ten-question interview round with no feedback until the end; ask the candidate to share the debrief screen, and talk through the misses.

  • A data engineer
  • A platform engineer
  • A forward deployed engineer

Run a team session

Pick a skill and print its pack. Read each scenario aloud, let everyone choose A, B or C, argue, then turn to the answer key at the back. Allow about five minutes a scenario.

Team session pack · Data engineer

Streaming and ingestion

7 scenarios from the Data Engineer Simulator, brickster.ai/data-engineer-simulator

  1. 1. The hourly totals come up short

    A Structured Streaming job on Databricks counts orders per hour into a Delta table, with a ten minute watermark. Phones that were offline send their orders hours later, and those rows are dropped. Finance noticed that yesterday's total is short.

    1. AFilter out any event older than ten minutes so the numbers stop moving.
    2. BLengthen the watermark to the lateness you really see, so each hour stays open for late rows.
    3. CAdd a nightly batch job that recomputes yesterday from scratch.
  2. 2. The stream stopped on a new column

    A vendor added a column to their files. The Auto Loader stream on Databricks that loads them failed with an unknown field error, and the on-call channel is asking what broke.

    1. ASwitch to rescue mode, so new columns go into the rescued data column and the stream never stops.
    2. BNothing broke. Restart the stream, and set the job to restart by itself next time.
    3. CPin the old schema and ignore columns you do not know.
  3. 3. A small change to a running stream

    A Structured Streaming job on Databricks that reads a Delta table needs one more filter. A colleague says the safe way to ship a change is to delete the checkpoint folder and start clean.

    1. AKeep the checkpoint. Stop the stream, add the filter, and start it again from the same checkpoint.
    2. BStart with a new checkpoint, and set the starting version to the point where the old run stopped.
    3. CDelete the checkpoint and start clean.
  4. 4. Customers keep getting their old address back

    A feed of customer changes from the source database sometimes arrives out of order. Your Databricks job applies changes to the Delta table as they arrive, so an older update can land on top of a newer one.

    1. AWrite a MERGE that keeps the newest change per customer in each batch and updates only when the change is newer than the row.
    2. BSort each batch by arrival time before applying it.
    3. CMove it to a Lakeflow pipeline's change data capture flow, and tell it which column orders the changes.
  5. 5. A stream that waits all day for one delivery

    Files land in cloud storage once a night. The Auto Loader stream that loads them into Databricks runs around the clock, on a cluster that is idle for twenty three hours a day.

    1. AKeep it running and lengthen the trigger interval to one hour.
    2. BReplace it with a nightly batch job that reads the whole folder.
    3. CKeep the stream code, and run it as a scheduled job with the available now trigger.
  6. 6. The stream gets slower every week

    A Structured Streaming job on Databricks drops duplicate events by event id. It has run for three months, its state holds every id it has ever seen, and each batch is slower than the last.

    1. ARestart the stream with a new checkpoint every month to clear the state.
    2. BGive the workers more memory and disk, so the state store can hold more ids.
    3. CDeduplicate inside a watermark, so ids older than the lateness you expect are forgotten.
  7. 7. Where should the new pipeline read from?

    You are designing a Lakeflow pipeline on a Kafka topic that keeps messages for seven days. The cleaning rules will change as the business learns what it needs.

    1. ALand the raw messages in a Bronze table untouched, keep them, and build the cleaned tables from Bronze.
    2. BClean straight from Kafka into Silver, and ask for the topic to keep thirty days.
    3. CClean straight from Kafka into Silver. A full refresh can always rebuild it.

Answer key

  1. 1. B: Lengthen the watermark to the lateness you really see, so each hour stays open for late rows.

    A watermark tells a streaming query how late data may arrive. Windows stay open that long, then close and free their state, and a row that comes later can be dropped. In Structured Streaming that is withWatermark on the event time column.

    https://www.brickster.ai/data-engineer-simulator/scenarios/late-events-missing-from-streaming-totals

  2. 2. B: Nothing broke. Restart the stream, and set the job to restart by itself next time.

    When Auto Loader infers the schema, its default is to add a new column to the schema it tracks, stop, and carry on after a restart. The stop is by design, so the stream belongs in a job that restarts it.

    https://www.brickster.ai/data-engineer-simulator/scenarios/auto-loader-stream-failed-on-a-new-column

  3. 3. A: Keep the checkpoint. Stop the stream, add the filter, and start it again from the same checkpoint.

    The checkpoint is where a stream records how far it has read. A change such as adding a filter can restart from the same checkpoint. Without the checkpoint the stream starts fresh, and a Delta source is read again from the beginning.

    https://www.brickster.ai/data-engineer-simulator/scenarios/change-a-running-stream-without-losing-the-checkpoint

  4. 4. C: Move it to a Lakeflow pipeline's change data capture flow, and tell it which column orders the changes.

    AUTO CDC in Lakeflow pipelines (once called APPLY CHANGES) applies a change feed to a table. SEQUENCE BY names the column that orders the changes, so records that arrive out of order are handled for you.

    https://www.brickster.ai/data-engineer-simulator/scenarios/cdc-changes-arrive-out-of-order

  5. 5. C: Keep the stream code, and run it as a scheduled job with the available now trigger.

    A stream does not have to run all the time. With the available now trigger it processes everything that is new and then stops, so a schedule can run it like a batch job while the checkpoint remembers what was already loaded.

    https://www.brickster.ai/data-engineer-simulator/scenarios/stream-runs-all-day-for-nightly-files

  6. 6. C: Deduplicate inside a watermark, so ids older than the lateness you expect are forgotten.

    Dropping duplicates in a stream means remembering keys. Without a watermark the stream has to remember all of them for ever. With one, dropDuplicatesWithinWatermark keeps a key only as long as a duplicate could still arrive.

    https://www.brickster.ai/data-engineer-simulator/scenarios/streaming-deduplication-state-keeps-growing

  7. 7. A: Land the raw messages in a Bronze table untouched, keep them, and build the cleaned tables from Bronze.

    A full refresh clears a streaming table and processes its source again, so it brings back only what the source still holds. Keep the raw data in a Bronze table, and set pipelines.reset.allowed to false on it so that a full refresh cannot clear it.

    https://www.brickster.ai/data-engineer-simulator/scenarios/pipeline-on-a-kafka-topic-with-short-retention

Rather read them on screen? All 77 scenarios, grouped by skill.