47 scenario questions for data and platform engineers
Each one is a situation that really happens on Databricks, with three ways to handle it, the best call, and the docs page behind it. They are the tickets of the Data Engineer Simulator: read them here, or play them for points and promotions.
Preparing for an interview?
Take an interview round: 10 of these in a row, nothing said until the end, then a debrief with the best call for each one you missed. About ten minutes, with a clock if you want one.
24 scenarios for a data engineer
Pipelines, streams and tables: late data, duplicates, slow jobs and loads that have to be right by morning.
Streaming and ingestion · 7
- The hourly totals come up shortJunior and upA 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.
- The stream stopped on a new columnJunior and upA 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.
- A small change to a running streamJunior and upA 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.
- Customers keep getting their old address backMid level and upA 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.
- A stream that waits all day for one deliveryMid level and upFiles 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.
- The stream gets slower every weekSenior and upA 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.
- Where should the new pipeline read from?Staff and upYou 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.
Delta tables · 6
- Revenue doubled overnightJunior and upA nightly Databricks job appended its batch to the Delta sales table, failed on a later step, and the retry appended the same batch again. The table now holds every order from last night two times.
- Someone deleted the customersJunior and upA colleague ran a DELETE with the wrong filter on the customers Delta table. Half the rows are gone, and they are asking, quietly, whether it can be undone.
- How should the new table be laid out?Mid level and upYou are creating a 50 gigabyte events table in Delta on Databricks. Most queries filter by user id and by date. A colleague suggests partitioning it by user id.
- You need to test a risky changeMid level and upYou rewrote the logic that updates a 600 gigabyte orders table in Delta. You want to try it on real data in your Databricks workspace before it touches production.
- Which region was this customer in back then?Senior and upSales wants revenue by the region each customer was in at the time of the sale. The customers Delta table holds only the current region: every change overwrites the old one. They will ask again next year.
- Six weeks of wrong totalsStaff and upA bug in the tax logic wrote wrong totals to the Gold sales table, a Delta table, for the last six weeks. The fix is merged. The table is read all day, and the nightly load has to keep running.
Performance · 6
- The dashboard takes four minutesJunior and upA Delta table fed by a stream every minute now holds hundreds of thousands of tiny files. Databricks SQL queries on it crawl.
- One task has been running for an hourJunior and upA Spark join on Databricks between two billion order rows and a table of 300 stores is stuck. Almost every task finished in seconds and one is still going. One store holds nearly half the orders, and Spark did not broadcast the store table by itself.
- The cleaning step takes most of the runJunior and upA Databricks job spends forty minutes of every hour in one step: a Python function, run row by row as a Spark UDF, that trims names and parses dates.
- The nightly job no longer fits in the nightMid level and upA Databricks job rewrites a two terabyte Delta table from scratch every night. About one percent of the rows change in a day. It now finishes after the morning reports start.
- Twenty dashboards, one heavy queryadded 29 NovemberMid level and upTwenty dashboards on Databricks SQL each run the same heavy aggregation over the orders table, all day. New orders arrive all day, so no cached result lasts. The SQL warehouse is busy, and every dashboard takes a minute to open.
- The MERGE takes two hoursSenior and upA nightly MERGE loads one day of events into a Delta table that holds three years, matching on event id alone. It reads almost every file in the table to look for matches.
Data quality and change · 5
- Gold has orders with no customerJunior and upA source system sometimes sends orders with an empty customer id. Your Lakeflow pipeline carries them into the Gold table, where they break the join behind the sales dashboard.
- An order for minus three itemsadded 29 NovemberJunior and upThree jobs write to the orders Delta table on Databricks. One of them let through an order with a quantity of minus three, and the finance report built on the table came out wrong.
- The primary key did not stop the duplicatesadded 29 NovemberSenior and upThe customers table in Unity Catalog on Databricks has a PRIMARY KEY on customer id. An analyst finds the same customer id on two rows and asks how the key let that happen.
- A column name everyone readsStaff and upThe column cust_no in a Gold table in Unity Catalog should be called customer_id. Dozens of dashboards and jobs across the company read that table, and you do not own most of them.
- Two dashboards, two numbersPrincipal and upTwo Databricks dashboards disagree: Sales reports 41,000 active customers and Finance reports 38,500. Both are right by their own definition, and the board has asked which one is true.
23 scenarios for a platform engineer
Cost, access, secrets and compute: the things everyone else assumes just work.
Cost and compute · 7
- A cluster ran all weekendJunior and upSomeone left a large all-purpose cluster running in your Databricks workspace from Friday evening. It did nothing for sixty hours, and the bill shows it.
- The nightly jobs run on the shared clusterJunior and upTwelve scheduled Databricks jobs run on the all-purpose cluster people use for notebooks. The jobs slow the notebooks down, and the cluster never gets to shut off.
- The job died with an out of memory errorJunior and upA nightly Databricks job fails on the driver with an out of memory error. Its last step calls collect() on a table that has grown to 80 million rows.
- Which team spent the money?Junior and upFinance wants the Databricks bill split by team. Clusters and jobs are named however their owners liked, and nothing says who they belong to.
- Dashboards queue at nineMid level and upEvery morning two hundred people open their dashboards at once. Each query alone is fast, and the Databricks SQL warehouse shows a long queue until half past nine.
- Cut the cost of the night jobsSenior and upThe nightly batch jobs run for three hours on Databricks clusters of on-demand machines. They can be retried, nobody waits for them, and you are asked to cut their compute cost.
- Five minutes of waiting for two minutes of workStaff and upThree hundred small Databricks jobs run through the day. Each one waits about five minutes for its job cluster to start, then works for two. The teams complain that results arrive late.
Access and governance · 9
- An analyst needs one tableJunior and upA new analyst in finance needs to read the invoices table in Unity Catalog. Their manager wants it done before a 14:00 meeting.
- Marketing wants the customers tableJunior and upMarketing analysts need the customers table in Unity Catalog for a campaign. It has an email column they are not allowed to see.
- A data scientist needs the scanned contractsMid level and upThousands of PDF files sit in a cloud storage folder. A data scientist needs to read them from a Databricks notebook and asks you for the storage access key.
- Each region may see only its own salesadded 29 NovemberMid level and upTwelve regional managers query one sales table in Unity Catalog on Databricks. Each of them may see only the rows of their own region, and head office sees everything.
- Who looked at the salaries table?Senior and upHR believes someone outside the team read the salaries table in Unity Catalog last week, and asks you for a list of everyone who accessed it.
- A partner needs your product tableSenior and upA retail partner wants a daily view of your product catalog table. They have their own data platform, and it is not Databricks.
- Every grant goes through youStaff and upEight teams keep their data in one Unity Catalog catalog. Every request to read a table lands in your queue, forty a week, and you rarely know whether the answer should be yes.
- Four hundred tables with personal dataStaff and upAn audit found email and phone columns in about four hundred Unity Catalog tables. All of them must be masked for everyone outside the privacy group, and so must the tables created next month.
- A business unit wants its own islandPrincipal and upA newly bought company in the same region insists on its own Unity Catalog metastore, so that nobody at head office can touch its data. Next quarter the two sides will need to join each other's tables.
Operations · 7
- A password is in the repoJunior and upDuring a review you spot a production database password, in plain text, in a Databricks notebook that was committed to git last month.
- Forty jobs failed at onceJunior and upEvery Databricks job owned by an engineer who left on Friday failed this morning. Their account was deactivated, and the jobs ran as them.
- One upgrade broke everyone's notebooksJunior and upAn analyst installed a newer pandas as a library on the shared Databricks cluster. After the restart, three other people's notebooks fail on that cluster.
- The orders table is goneMid level and upSomeone cleaning up a schema dropped a Unity Catalog managed table that three dashboards read. It happened twenty minutes ago.
- The runtime is reaching end of supportMid level and upTwo hundred jobs run on a Databricks Runtime LTS version that loses support next month. The new one changes a few behaviours.
- Who changed the job?Mid level and upA production job started failing after someone edited it in the Databricks workspace. Nobody remembers what it looked like before, and piecing the old settings together from the audit log is slow.
- Task six of eight failedadded 29 NovemberMid level and upA nightly Databricks job has eight tasks. The first five ran for two hours and succeeded, then task six failed because a source file arrived late. The file is there now, and the reports are due at nine.
Had one of these at work?
The best tickets come from real incidents. Send us yours: what happened, what you did, and what you would tell a colleague to do.
We read every one and check it against the Databricks docs. The ones that hold up become tickets in the simulator.
Send a scenarioIt opens the feedback form with the questions already in it. Five minutes.
Every scenario was checked against the Databricks documentation, and each page links the docs page its answer rests on. Spotted something wrong? Tell us. brickster.ai is independent and is not affiliated with Databricks.