Free practice questions · Databricks
10 Databricks Certified Data Engineer Professional practice questions, with answers
Exam-style questions from the CertLumen course, spread over the exam's sections by their weights. Each has its answer and why. They're written for practice: never questions from the real exam.
Question 1 · Developing Code for Data Processing using Python and SQL
A serverless job environment lists /Volumes/prod/libs/geo_utils-2.1.0.tar.gz, a source archive with C extensions. Runs fail during environment setup with *Failed building wheel for geo_utils*. Which approach fixes this in a way serverless supports?
- ABuild wheels in CI, upload them to the volume and list the
.whlinstead of the archive - BAdd an init script that installs a C compiler before the job's environment is built
- CInstall the archive with
%sh pip installin the first cell of the notebook instead - DPut
--no-depsin front of the archive path so that pip skips the build step
Show the answer
A. pip must compile a source distribution, which needs a build backend, compilers and headers that the environment may not have. Prebuilding wheels in CI removes the build step at run time. Because this package has native code and serverless can run on aarch64 or x86_64, build both variants (selected with platform_machine markers) or keep the code pure Python.
Question 2 · Developing Code for Data Processing using Python and SQL
orders_enriched is a streaming table that joins STREAM(orders) to the customers dimension to add each customer's segment. Marketing reclassifies segments every month, and analysts require every historical order to show the customer's current segment, without anyone running manual full refreshes. What should the engineer change?
- ARead
customerswithskipChangeCommitsso that segment updates no longer interrupt the stream - BDefine
orders_enrichedas a materialized view, which reflects dimension changes on each refresh - CChange the stream-static join into a stream-stream join with a watermark on both of its inputs
- DAdd
TRACK HISTORY ON segmentto the streaming table so that earlier rows are updated in place
Show the answer
B. A streaming table processes each order once: a stream-static join uses the dimension as it is at that moment and never recomputes rows already written, so old orders keep the old segment. A materialized view is kept correct with respect to all its sources on every refresh, including changed dimension rows, incrementally where possible.
Question 3 · Data Ingestion & Acquisition
A team is configuring the Lakeflow Connect SQL Server connector. The order_lines table has no primary key, and the business requires SCD type 2 history for it in Unity Catalog. What must be enabled on the source?
- AChange tracking on the database and the table, because it records every operation with the row's old values
- BSQL Server change data capture (CDC), which works without a primary key and supports SCD type 2
- CTransactional replication to a read replica, which the gateway then reads instead of the primary instance
- DTemporal (system-versioned) tables, which the connector reads to rebuild the SCD type 2 history of each row
Show the answer
B. Change tracking requires a primary key and only records that a row changed, so Databricks recommends it for tables that have a key. SQL Server CDC records every operation and works without a primary key, and SCD type 2 targets require CDC; change tracking is not supported for them. If both are enabled on a table, the connector uses change tracking.
Question 4 · Data Manipulation
A silver job keeps the latest record per order_id from a bronze table with late-arriving duplicates. It uses QUALIFY rank() OVER (PARTITION BY order_id ORDER BY updated_at DESC) = 1, yet some orders still appear twice in silver. What should the engineer change?
- AUse
row_number()and add a tie-breaker such as_ingested_at DESCto the ORDER BY - BReplace
QUALIFYwith aWHEREclause, because QUALIFY is evaluated before the window function - CAdd
DISTINCTto the SELECT list so that identical duplicate rows are removed after ranking - DChange the ordering to
updated_at ASC, because rank() returns the newest row last in each partition
Show the answer
A. When two versions of an order share the same updated_at, rank() gives both rank 1, so both pass the filter. row_number() always assigns exactly one row number 1 per partition, and a deterministic tie-breaker makes sure reruns keep the same row.
Question 5 · Monitoring and Alerting
An engineer needs one alert that triggers only when both error_count > 100 and error_rate > 0.05 hold in the same result row. The alert editor compares one value with one threshold. How should the alert be built?
- ACompute a 0/1
breachflag for both tests in the SQL and alert when it equals 1 - BSet the threshold type to another column so that
error_countis compared witherror_rate - CUse the
COUNTaggregation onerror_count - DCreate two alerts and enable Notify on OK on both, so a message arrives only when both trigger
Show the answer
A. Alert conditions evaluate one source value against one threshold. For multi-column logic, the docs recommend putting the logic in the query and returning a value, such as 1 or a Boolean, for the alert to trigger on.
Question 6 · Cost & Performance Optimization
Predictive optimization is enabled at the account level. Schema analytics.sandbox was set with DISABLE PREDICTIVE OPTIMIZATION, and later the table analytics.sandbox.daily_kpis was set with ENABLE PREDICTIVE OPTIMIZATION. Which tables in the schema does predictive optimization maintain?
- AOnly
daily_kpis, because its explicit table setting overrides the schema's DISABLE - BNone, because a schema-level DISABLE overrides any setting on the tables inside it
- CAll managed tables in the schema, because the account-level setting takes precedence
- DOnly
daily_kpis, and only after the schema's setting is changed toINHERIT
Show the answer
A. Settings follow the Unity Catalog hierarchy: each object inherits from its parent unless it is explicitly enabled or disabled, and the nearest explicit setting wins. The table's ENABLE overrides the schema's DISABLE; the schema's other tables inherit DISABLE.
Question 7 · Cost & Performance Optimization
Legacy Change Data Feed was enabled on workspace.crm.customers at table version 12. A backfill job runs SELECT * FROM table_changes('workspace.crm.customers', 5) and fails. Why?
- A
table_changesrequires an ending version too - BCDF has no change data for versions before it was enabled
- CVersion arguments must be passed as timestamp strings in the
yyyy-MM-ddformat - D
table_changescan only be called from inside a Structured Streaming query
Show the answer
B. Legacy CDF records changes only after it is turned on, and requesting a starting version before enablement raises an error. The end version is optional; integers are versions and strings are timestamps.
Question 8 · Ensuring Data Security and Compliance
A Structured Streaming job reads prod.crm.users_bronze with spark.readStream.table(...) and appends to prod.crm.users_silver. After the GDPR job deletes rows from bronze, the stream fails because its source is no longer append-only. Which change keeps the stream running while still honouring the erasure?
- ARun a full refresh of the silver table after every GDPR delete so the stream restarts from the current state
- BSet the
ignoreChangesoption on the read and accept that the deleted users remain in the silver table - CSet
skipChangeCommitson the read and delete the same users from the silver table with DML - DSwitch the stream to
trigger(availableNow=True)so that it processes the delete commits as a batch
Show the answer
C. skipChangeCommits makes the stream ignore commits that delete or update existing rows, so the GDPR delete on bronze no longer breaks it. Because those commits are skipped, the erasure must be applied downstream separately with DELETE or MERGE. A full refresh reprocesses everything and can lose data whose upstream source has expired.
Question 9 · Data Governance
An admin revokes SELECT on table prod.hr.salaries from the hr-readers group, yet members can still query the table. SHOW GRANTS ON TABLE prod.hr.salaries lists a SELECT row for hr-readers whose objectType is SCHEMA and objectKey is prod.hr. What should the admin do?
- ARepeat the
REVOKEwithCASCADE, so that it also removes privileges inherited from the parent schema - BGrant
SELECTon the table and then revoke it again, so that the table-level change overrides the schema - CTransfer ownership of the table to the admin first, because only an owner can block inherited grants
- DRevoke
SELECTwhere it was granted, on schemaprod.hr, and then re-grant narrower access if needed
Show the answer
D. Privileges granted on a schema inherit to all its tables and cannot be removed at the child level; a table-level REVOKE only removes a direct grant and succeeds even if there was none. SHOW GRANTS shows the inherited row with the schema as the object it is attached to, so revoke it there and grant narrower access afterwards.
Question 10 · Debugging and Deploying
A job on classic compute with spot workers sometimes takes twice as long. During the slow runs, the Spark UI jobs timeline shows several executors removed (in red), and stages rerun their unfinished tasks. Before changing any memory settings, what should the engineer check first?
- AThe SQL/DataFrame tab, to see whether the physical plan changed between slow and fast runs
- BThe compute event log, for spot instance losses or autoscaling events at those times
- CThe
system.billing.usagetable, to compare the DBUs of slow runs and fast runs - DThe Environment tab of the Spark UI, to confirm the Spark version did not change
Show the answer
B. When an executor is removed, Spark reruns its unfinished tasks. The Databricks guide lists three common causes: autoscaling (expected), spot instance loss and out-of-memory. The compute event log shows resizing and lost spot nodes, so check it before assuming a memory problem; if it shows nothing, open the Executors tab to read the failed executors' logs.
How ready are you?
Take ten more, weighted like the real exam, and see your score by section and a rough chance of passing. The course has 340 questions and 4 timed practice exams.
About the course · Free study guide · A question a day by email