All Databricks exams
Free Databricks Certified Data Engineer Associate practice test: 30 questions with answers
30 original questions for Databricks Certified Data Engineer Associate, drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.
- Free questions
- 30
- Full bank
- 112 questions
Databricks Certified Data Engineer Associate exam guide: topics, cost and format
All 30 Databricks Certified Data Engineer Associate questions with answers
The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.
Data Transformation and Modeling (5 questions)
Question 1
A silver Delta table must be refreshed from a daily batch of changed customer rows. Matching customer_id rows should be updated and new ones inserted. Which statement does this?
- AINSERT OVERWRITE target SELECT * FROM updates, which replaces every existing customer row in the target
- BMERGE INTO target USING updates ON customer_id WHEN MATCHED THEN UPDATE WHEN NOT MATCHED THEN INSERT
- CCREATE OR REPLACE TABLE target AS SELECT * FROM updates, which rebuilds the table from the batch alone
- DINSERT INTO target SELECT * FROM updates, which appends every batch row to the existing table
Show answer and explanationHide answer
Correct answer: BMERGE INTO applies updates to matched keys and inserts unmatched ones in a single atomic transaction, which is the upsert the requirement describes. INSERT OVERWRITE drops the existing customers that are not in the batch, and a plain INSERT adds duplicates of rows already present. CREATE OR REPLACE rebuilds the table from the batch alone and loses the rest.
Question 2
Which TWO statements about Delta Lake are correct? (Choose two.)
- ADelta tables provide ACID transactions on files held in cloud object storage
- BEvery committed change is recorded as an entry in the table's _delta_log transaction log
- CVACUUM deletes old table versions immediately, so time travel never works afterwards
- DOPTIMIZE removes all previous versions of the table as part of compaction
- EDelta tables can only be registered in the Hive metastore and not in Unity Catalog
Show answer and explanationHide answer
Correct answer: A, BDelta Lake adds ACID transactions over Parquet files by recording each commit in the _delta_log transaction log. VACUUM removes files no longer referenced beyond the retention threshold rather than immediately, so recent versions remain available. OPTIMIZE compacts files without deleting history, and Delta tables can be governed through Unity Catalog as well as the Hive metastore.
Question 3
A table holds several updates per customer. The silver layer needs only the latest row per customer_id, based on updated_at. Which SQL pattern achieves this?
- AGROUP BY customer_id with MAX(updated_at) and no other columns in the select list
- BSELECT DISTINCT * so that only one copy of each customer's rows is returned
- CORDER BY updated_at LIMIT 1 applied to the whole table
- DROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY updated_at DESC) = 1
Show answer and explanationHide answer
Correct answer: DA window function ranks each customer's rows by updated_at, and keeping rank 1 returns the full latest row for each key. SELECT DISTINCT keeps every version because the timestamps differ. A GROUP BY with MAX returns only the timestamp and loses the other columns, and a single LIMIT returns one row for the entire table.
Question 4
Which TWO transformations are narrow, meaning each output partition depends on a single input partition with no shuffle? (Choose two.)
- Afilter
- BgroupBy followed by an aggregation
- Cselect or withColumn
- Da join between two large tables with no broadcast hint
- EorderBy across the full dataset
Show answer and explanationHide answer
Correct answer: A, CFilter and column projection or derivation act on each partition independently, so they need no shuffle. Grouping, joining two large tables and global ordering all redistribute rows between partitions, which makes them wide transformations.
Question 5
A 50 MB dimension table is joined to a 500 GB fact table, and the join is slow because of a large shuffle. Which hint helps?
- ARepartition the fact table into a single partition before the join runs
- BCollect the dimension table to the driver and loop over the fact rows in Python
- CApply a broadcast hint to the small dimension table
- DCache the 500 GB fact table in memory before the join is written
Show answer and explanationHide answer
Correct answer: CA broadcast join sends the small table to every executor, so the large fact table does not have to be shuffled. A single partition for 500 GB would overload one task, and collecting to the driver and looping in Python removes the parallelism Spark provides. Caching the fact table does not avoid the shuffle.
Governance and Security (5 questions)
Question 6
A group needs to read one table, sales.orders.transactions, in Unity Catalog, but must not be able to create or change tables. Which grants are correct?
- AUSE CATALOG and USE SCHEMA on the parents, plus SELECT on the table
- BGRANT MODIFY on table sales.orders.transactions to the group, so the group can read the table and also write to it
- CGRANT ALL PRIVILEGES on catalog sales to the group, so that access to all its schemas is covered for future work
- DGRANT SELECT on catalog sales to the group, which is inherited by every table and view below it in the catalog
Show answer and explanationHide answer
Correct answer: CReading a table in Unity Catalog needs USE CATALOG and USE SCHEMA on its parents plus SELECT on the table, and nothing more. ALL PRIVILEGES on the catalog gives create and modify rights the group should not have. MODIFY allows writes, which the requirement excludes.
Question 7
A column of customer email addresses must be hidden from analysts but visible to the support group. Which Unity Catalog feature enforces this in the data layer?
- AA view that omits the email column, with analysts still granted SELECT on the base table
- BEncryption of the email values with a key that every analyst is given
- CA column mask function on the email column that returns a masked value for other groups
- DRenaming the email column to a less obvious name so that analysts do not query it
Show answer and explanationHide answer
Correct answer: CA column mask function applies to every query on the column, so the masking holds whichever tool reads the table. A view is bypassed when analysts keep SELECT on the base table, shared encryption keys give analysts the means to decrypt, and renaming provides no protection.
Question 8
Which statement about VACUUM on a Delta table is correct?
- AIt deletes the transaction log, which removes the history of every table commit
- BIt removes unreferenced data files older than the retention threshold
- CIt recalculates column statistics used by the query optimiser for each table
- DIt merges small files into larger ones so that each file read is more efficient
Show answer and explanationHide answer
Correct answer: BVACUUM deletes unreferenced data files older than the retention threshold, and once those files are gone, the older versions can no longer be read. Deleting the transaction log would destroy the table history, which VACUUM does not do. Merging small files is the job of OPTIMIZE, and recalculating statistics is a separate operation.
Question 9
A governance team wants to see which upstream tables and notebooks produced a gold table. Which Unity Catalog capability shows this?
- AA lineage agent that must be installed on every cluster before a job runs
- BAutomatic lineage capture for supported queries, visible in Catalog Explorer
- CColumn-level tags that the engineer must add by hand for each query
- DLineage that is available only for Delta Live Tables pipelines and no other jobs
Show answer and explanationHide answer
Correct answer: BUnity Catalog captures lineage automatically for supported queries and shows upstream and downstream relationships in Catalog Explorer. The other options describe mechanisms that are not required or that restrict lineage to one pipeline type, which is not how it works.
Question 10
A data engineer must give an external partner read access to one shared dataset without copying it into the partner's account. Which Databricks feature supports this?
- AA personal access token of the engineer shared with the partner's team
- BA CSV export emailed to the partner every week with the latest rows
- CDelta Sharing, which lets the partner read the shared data without a copy
- DA public cloud storage link that anyone with the URL can open
Show answer and explanationHide answer
Correct answer: CDelta Sharing gives recipients read access to shared tables without copying the data, and access can be revoked centrally. Email exports create copies that drift, sharing a personal token exposes the engineer's identity, and a public link exposes the data to anyone who finds it.
Data Ingestion and Loading (5 questions)
Question 11
A team must ingest JSON files that land continuously in cloud object storage. They need schema inference, tracking of files already processed, and no rescans of old files. Which feature fits best?
- AAuto Loader using the cloudFiles source with a schema location
- BA nightly spark.read of the full folder with overwrite mode on the output
- CA Python task that lists the folder with dbutils.fs.ls and appends each new file
- DA Delta MERGE keyed on file name, built from a manually maintained file list
Show answer and explanationHide answer
Correct answer: AAuto Loader uses the cloudFiles source to discover new files incrementally, stores the inferred schema in the schema location, and records which files are already processed. A nightly full read rescans everything, and listing folders by hand rebuilds bookkeeping that Auto Loader already does. A MERGE on a manually maintained list is fragile and pushes that bookkeeping onto the engineer.
Question 12
A stream reads from Kafka into a Delta table. After a restart, the team must not reprocess or lose records. Which setting provides this?
- ACaching the source DataFrame in memory before each micro-batch is written
- BA continuous trigger with no checkpoint, so that the stream always reads the newest data available
- CA checkpoint location for the streaming query that records offsets and state
- DOverwrite mode on every micro-batch so that each write replaces the previous one
Show answer and explanationHide answer
Correct answer: CA checkpoint location stores the offsets and state of the query, so after a restart it resumes exactly where it stopped. A trigger with no checkpoint loses the position on restart, and caching does not persist anything across failures. Overwrite mode replaces data each batch rather than recording progress.
Question 13
Files arrive in a folder on a schedule, and the team wants an idempotent SQL load that skips files already loaded, without a streaming job. Which statement fits?
- AINSERT OVERWRITE the table with a read of the whole folder on every scheduled run
- BCOPY INTO a Delta table from the folder, which skips files already loaded
- CINSERT INTO the table from a read of the folder on every run with no tracking
- DTRUNCATE the table and then reload every file in the folder from the beginning
Show answer and explanationHide answer
Correct answer: BCOPY INTO tracks the files it has loaded, so reruns skip them and the load is idempotent without a streaming job. Overwriting or truncating rebuilds the table on each run, and a plain INSERT re-adds files already loaded, creating duplicates.
Question 14
Some incoming JSON records contain fields that are not in the table schema. The pipeline must keep those records and capture the unexpected fields for review. Which Auto Loader behaviour does this?
- ADropping any record with an unexpected field before it reaches the target table
- BStoring each entire record as one string with no parsing into columns
- CA rescued data column that holds the unexpected fields for each affected record
- DFailing the job on the first new field so that the schema can be changed manually
Show answer and explanationHide answer
Correct answer: CThe rescued data column keeps records intact and places the unexpected values in a separate column, so nothing is lost and the fields can be reviewed. Dropping records loses data, and failing the job stops the pipeline when it does not need to. A single string column makes the data unusable for normal queries.
Question 15
Which THREE options are valid settings for Auto Loader schema handling? (Choose three.)
- AcloudFiles.mode set to overwrite so that each run replaces the previous output
- BcloudFiles.schemaLocation, which stores the inferred schema so it is reused across runs
- CcloudFiles.partitionBy set to a hash of the file name to balance the load
- DcloudFiles.format set to json for a folder of JSON files
- EcloudFiles.schemaEvolutionMode, which controls how new columns are handled
Show answer and explanationHide answer
Correct answer: B, D, ESchema location, file format and schema evolution mode are real Auto Loader options that control how the schema is stored, read and changed. There is no cloudFiles.mode option for overwriting, and partitioning the source files by a hash of the name is not a setting of the cloudFiles source.
Working with Lakeflow Jobs (4 questions)
Question 16
A Lakeflow Job has three tasks: ingest, transform and publish. Transform must run only after ingest succeeds, and each run should use compute created for that run and removed afterwards. Which configuration is correct?
- ASchedule each task as its own notebook at a fixed time with no dependencies
- BDefine task dependencies and attach a job cluster to the tasks
- CPut all three steps in one notebook cell and rely on a single retry setting
- DAttach all tasks to one all-purpose cluster that is started manually before each run
Show answer and explanationHide answer
Correct answer: BTask dependencies enforce the order, and a job cluster is created for the run and terminated when it finishes, which matches the cost requirement. Fixed-time separate schedules cannot guarantee that transform waits for ingest. An all-purpose cluster is meant for interactive work and is more expensive for scheduled runs.
Question 17
A scheduled job occasionally fails because a source API is briefly unavailable. The team wants the failed task to retry automatically, with no manual action. What should they configure?
- AA second schedule for the same job that runs two hours after the first
- BRemoval of the failing task so that the rest of the job still completes
- CMaximum retries and a retry interval on the task that calls the API
- DA larger cluster for the whole job so that calls succeed on the first attempt
Show answer and explanationHide answer
Correct answer: ASetting retries and a retry interval on the task handles transient failures automatically, which is what the team needs. A second schedule runs the whole job again without targeting the failed step, removing the task drops required work, and a bigger cluster does not help when the API itself is unavailable.
Question 18
One notebook must process a different date each time a scheduled job runs. Which approach passes the date at run time?
- ADefine a job parameter and read it in the notebook with dbutils.widgets.get
- BSet the date as a Spark configuration value on the cluster used by the job
- CHard-code each date in a separate copy of the notebook for each scheduled run
- DRead the output of the previous run and increment the date stored in it
Show answer and explanationHide answer
Correct answer: AA job parameter supplies the value at run time, and dbutils.widgets.get reads it inside the notebook, so one notebook serves every date. Separate copies multiply maintenance, and cluster-level Spark configuration is shared across runs and jobs. Reading previous output couples runs together and is fragile.
Question 19
A production job runs every night for 40 minutes and does not need interactive use. Which compute choice is most cost-effective?
- AA shared all-purpose cluster that stays running all day for the whole team
- BA personal cluster kept alive by an engineer who restarts it each morning
- CA cluster started by hand each night and left running until someone stops it
- DA job cluster created for each run and terminated when the run finishes
Show answer and explanationHide answer
Correct answer: DA job cluster exists only for the duration of the scheduled run, so the team pays for the 40 minutes it is used. An all-purpose cluster running all day is paid for continuously, and manually managed clusters that are left running waste compute.
Troubleshooting, Monitoring, and Optimization (4 questions)
Question 20
In the Spark UI, one task in a shuffle stage runs far longer than the rest because a single join key holds most of the rows. Which fix addresses the root cause?
- AEnable adaptive query execution skew join handling to split the heavy partition
- BIncrease the driver memory only, since the driver coordinates every shuffle in the job
- CReduce the shuffle partitions to one so that all rows are processed in one task
- DConvert the source Delta table to CSV so that the reader splits the data more evenly
Show answer and explanationHide answer
Correct answer: AAdaptive query execution's skew join handling splits oversized partitions at runtime, which spreads the heavy key across several tasks. Driver memory does not change how rows are distributed among executors. A single shuffle partition makes the skew worse by putting all rows in one task.
Question 21
A Spark query reads a Delta table that has thousands of tiny files, and reads are slow. Which action helps most?
- ARaise the shuffle partitions to ten thousand for every query in the workspace
- BRun OPTIMIZE on the table to compact small files into larger ones
- CConvert the table to CSV so that each file can be read independently
- DAdd more executors and leave the table layout unchanged
Show answer and explanationHide answer
Correct answer: BOPTIMIZE compacts small files into larger ones, which reduces the per-file overhead that slows reads. Very high shuffle partitions add task overhead without touching the file layout. CSV does not fix tiny files, and more executors cannot make up for fragmented storage.
Question 22
A Delta MERGE is slow because it compares every row in a large target table with the source. The target is partitioned by event_date, and the source covers only the last three days. What should the engineer do?
- AReplace the MERGE with a full overwrite of the target table on every run
- BAdd more columns to the merge key so that fewer rows match each source row
- CDisable the Delta transaction log so the merge does not need to record anything
- DAdd an event_date predicate to the MERGE so only recent partitions are scanned
Show answer and explanationHide answer
Correct answer: DA partition predicate lets Delta skip the partitions outside the three-day window, which removes most of the scan. A full overwrite rewrites the entire table on every run, and more merge columns do not reduce the scan. Disabling the transaction log removes the guarantees that make the merge safe.
Question 23
A slow Spark job is traced in the Spark UI. Which THREE findings point to a fix that would help? (Choose three.)
- AMany tiny files being read from storage for one table
- BA job that uses dbutils.widgets to take a run-time date parameter
- COne stage where a single task processes most of the shuffled data
- DRepeated spill to disk from executors that run out of memory during a join
- EA cell in the notebook that prints a long message after the job completes
Show answer and explanationHide answer
Correct answer: A, C, DMany small files, a skewed stage and memory spill to disk are common causes of slow Spark jobs, and each has a known remedy such as compaction, skew handling or better memory use and join strategies. Reading a widget parameter and printing a message are normal behaviour that does not slow the job.
CI/CD and Deployment (4 questions)
Question 24
Notebooks must be kept in Git with feature branches, and engineers should be able to commit and pull from the Databricks workspace. Which feature supports this?
- AExporting each notebook as an HTML file and storing the files on a shared drive
- BGit folders, which link a workspace folder to a remote Git repository and branch
- CCopying the notebooks into a new workspace for every feature that is being developed
- DStoring the notebooks inside a Delta table and versioning the table by its row count
Show answer and explanationHide answer
Correct answer: BGit folders connect a workspace folder to a Git repository so engineers can branch, commit and pull from the workspace. HTML exports lose the editable source, and copying workspaces for each feature creates drift. Storing notebooks in a Delta table is not how source control works.
Question 25
A team wants unit tests for their transformation functions to run automatically on every pull request, before code is deployed. Which practice fits?
- ASkip testing for transformations and rely on the dashboards to show when data looks wrong
- BKeep functions in a Python module, test with pytest in CI, then deploy
- CPaste the functions into a notebook cell and check the output by eye in the workspace
- DTest the functions only by running the production job once after each deployment
Show answer and explanationHide answer
Correct answer: BFunctions in a module can be imported and tested with pytest, and running those tests in CI blocks bad code before it reaches production. Testing after deployment exposes bad data to users first, and eyeballing a notebook is not repeatable. Waiting for dashboards to reveal problems is the slowest way to find a fault.
Question 26
Two engineers edit the same job definition in separate branches. Which practice prevents one change from silently overwriting the other when the code is merged?
- ARename the job for each engineer so that the two definitions never collide in the workspace
- BLet each engineer deploy directly to the shared production workspace as soon as the change works
- CKeep a single shared copy of the file that both engineers edit in place at the same time
- DMerge through a pull request with review, and resolve conflicts before the bundle is deployed
Show answer and explanationHide answer
Correct answer: DA pull request with review forces conflicts to be seen and resolved in source control before deployment, so one change cannot silently replace the other. Direct deploys and shared in-place editing both bypass that check, and renaming the job hides the collision without resolving it.
Question 27
Which THREE items belong in a Databricks Asset Bundle used for deployment? (Choose three.)
- AA personal access token of the engineer typed in plain text in the bundle file
- BThe resource definitions for jobs and pipelines that the bundle deploys
- CThe full history of every notebook run, stored as part of the bundle
- DTarget definitions that set the workspace and catalog for each environment
- ESource files for notebooks and Python modules referenced by the job tasks
Show answer and explanationHide answer
Correct answer: B, D, EA bundle declares resources, per-environment targets and the source files they run, which lets one definition deploy to several environments. Personal tokens must not be stored in plain text, and run history is runtime data that does not belong in the bundle.
Databricks Intelligence Platform (2 questions)
Question 28
A team needs ACID transactions and time travel on data stored in its own cloud object storage, with open file formats. Which table format meets this?
- AJSON lines files partitioned by ingestion date
- BPlain CSV files stored in a folder in the bucket
- CParquet files with no transaction log kept alongside them
- DDelta Lake tables
Show answer and explanationHide answer
Correct answer: DDelta Lake provides ACID transactions and time travel on top of open Parquet files in the customer's storage. CSV and JSON files have no transaction log, and bare Parquet files lack the commit history that enables atomic writes and time travel. Partitioning JSON by date does not add transactions.
Question 29
Which part of the Databricks Intelligence Platform runs BI and SQL analytics queries against lakehouse tables?
- ADatabricks SQL, which runs BI queries against lakehouse tables
- BLakeflow Declarative Pipelines, which transform raw files into tables
- CMLflow, which tracks model experiments and their runs
- DUnity Catalog, which stores dashboards and their query history
Show answer and explanationHide answer
Correct answer: ADatabricks SQL is the component for BI and analytical SQL against lakehouse tables. Lakeflow pipelines build tables rather than serve queries for reporting, MLflow handles machine learning tracking, and Unity Catalog governs data and does not host the query engine.
Ingestion and Loading (1 question)
Question 30
An analyst needs to read a Delta table as it looked on 1 January 2026, without changing the table. Which read does this?
- ASELECT * FROM table TIMESTAMP AS OF '2026-01-01' to read the table at that time
- BSELECT * FROM table WITH HISTORY to read the rows of every version
- CRESTORE TABLE table to read the table as it was, which rewrites its current state
- DVERSION OFF table to read the table without its history
Show answer and explanationHide answer
Correct answer: ATIMESTAMP AS OF reads the table as it was at that time without modifying it, which is time travel for a read. RESTORE changes the table to the earlier state, which the analyst should not do, and the other two options are not valid time travel syntax.