Free Databricks Data Engineer Professional practice test

20 questions for the Databricks Data Engineer Professional exam, taken from our 311-question bank and spread across its 10domains by their weighting. No sign-up needed: pick an answer to check it, or open “Show answer & explanation” under any question.

What this test covers

Question 1 · Developing Code for Data Processing using Python and SQL

A data engineering team uses Databricks Repos integrated with a Git provider. A team member accidentally committed a notebook containing a hard-coded API key directly to the main branch and pushed it to the remote repository. The team wants to remove the secret from the repository history. Which TWO actions should the team take as immediate remediation steps within Databricks and their Git workflow? (Select TWO)

Select 2 answers.

Show answer & explanation

Correct answers: A, D

  • A. Rotate/revoke the exposed API key in the target system immediately, since the secret is already compromised regardless of Git history cleanup.
  • D. Perform a git filter-repo or equivalent history-rewriting operation on the remote repository to remove the secret from all historical commits, then force-push the rewritten history.

Option A is correct — rotating/revoking the compromised credential is the single most critical immediate action; the secret must be treated as compromised the moment it was pushed. Option D is correct — to truly remove a secret from Git history, a history-rewriting tool like git filter-repo (or BFG Repo Cleaner) must be used on the remote, followed by a force-push; this is the standard Git remediation. Option F is incorrect — the Databricks Repos UI only manages the working state of the repo (branch switching, pull, commit, push); it cannot rewrite remote Git history. Option E is incorrect — deleting and re-cloning the Repo object in Databricks only affects the local workspace copy; the remote Git provider's history is completely unaffected. Option B is a good future prevention best practice but is not an immediate remediation for the already-exposed secret. Option C is incorrect — Databricks Unity Catalog audit logs record API actions, not notebook cell content or committed file contents; the secret would not be captured there.

Question 2 · Developing Code for Data Processing using Python and SQL

A Unity Catalog administrator runs the following SQL statement:

GRANT CREATE TABLE ON SCHEMA main.bronze TO data_engineers;

A member of data_engineers then tries to create a table in main.bronze and receives a permission error. What additional privilege is MOST likely missing?

Select 2 answers.

Show answer & explanation

Correct answers: A, E

  • A. USE SCHEMA on main.bronze
  • E. USE CATALOG on the main catalog

In Unity Catalog, privileges follow a hierarchy that requires USE permissions at every level of the namespace. To create a table in main.bronze, the user must have USE CATALOG on main AND USE SCHEMA on main.bronze in addition to CREATE TABLE. Without either of these, navigation through the namespace fails. Option B (CREATE SCHEMA) is unnecessary — the schema already exists. Option C (MODIFY) applies to modifying existing table data, not creating new tables. Option D (READ FILES) is a volume/external location privilege, not required for managed table creation.

Question 3 · Developing Code for Data Processing using Python and SQL

A data engineering team wants to share a curated Delta table with an external partner organization. The partner organization also uses Databricks. Using Delta Sharing, which sequence of steps does the DATA PROVIDER need to complete to make the table available?

Show answer & explanation

Correct answer: C

  • C. Create a recipient → Create a share → Add the table to the share → Grant the recipient access to the share

The correct Delta Sharing provider workflow is: (1) Create a recipient object that represents the external partner, (2) Create a share object that acts as a container for data assets, (3) Add the Delta table to the share, and (4) Grant the recipient access to the share so they can read the data. Option D has the order of recipient and share creation swapped and describes 'activating' the recipient before granting share access. Option A describes an older open-source Delta Sharing server model that does not apply to the Databricks-managed Delta Sharing workflow. Option B incorrectly introduces external locations and uses SELECT syntax that does not apply to shares.

Question 4 · Developing Code for Data Processing using Python and SQL

A data engineer is using the Databricks REST API to list all files in a DBFS directory path /mnt/raw-data. Which API endpoint and HTTP method is correct?

Show answer & explanation

Correct answer: D

  • D. GET /api/2.0/dbfs/list with a JSON body containing {"path": "/mnt/raw-data"}

The correct Databricks DBFS REST API endpoint for listing directory contents is GET /api/2.0/dbfs/list, and the path parameter is passed as a query parameter or in the request body as JSON. Option A uses an incorrect endpoint path /dbfs/ls which does not exist. Option C uses /dbfs/read, which is for reading file contents, not listing directories. Option B uses POST instead of GET; the list endpoint uses GET.

Question 5 · Developing Code for Data Processing using Python and SQL

A data engineer creates a Unity Catalog volume of type EXTERNAL in the catalog prod, schema raw, and names it landing_zone. The volume points to an S3 path s3://company-raw/landing/. Later, a colleague tries to list files in the volume using /Volumes/prod/raw/landing_zone/ and receives an access denied error, even though they have READ VOLUME on the volume. What is the MOST likely missing configuration?

Show answer & explanation

Correct answer: A

  • A. The colleague must be granted USE CATALOG and USE SCHEMA before READ VOLUME takes effect.

Unity Catalog enforces namespace traversal: a user must have USE CATALOG on prod and USE SCHEMA on prod.raw before any object-level privilege (including READ VOLUME) takes effect. Even with READ VOLUME, missing USE CATALOG/USE SCHEMA causes an access error. Option E is wrong — READ VOLUME is the correct privilege for reading volumes; SELECT applies to tables. Option C is plausible but describes an admin-level misconfiguration; the question specifies the volume already exists and the colleague has READ VOLUME, making missing USE grants the most common user-level cause. Option B is wrong — Unity Catalog volumes are accessed via the /Volumes/ path and do not require manual mounting. Option D is wrong — external volumes fully support access control.

Question 6 · Data Ingestion and Acquisition

New JSON files land continuously in a cloud storage location and must be ingested incrementally with automatic detection of new files and schema evolution. Which Databricks feature is designed for this?

Show answer & explanation

Correct answer: A

  • A. Auto Loader (cloudFiles)

Auto Loader (cloudFiles) incrementally and efficiently detects and ingests new files as they arrive, with schema inference/evolution and scalable file discovery. A one-time COPY INTO (B) isn't continuous, a full directory batch read (C) reprocesses everything, and Delta Sharing (D) shares data across orgs.

Question 7 · Data Transformation, Cleansing, and Quality

A data engineering team runs VACUUM on a Delta Lake table every night. After running VACUUM with default settings, a team member tries to query the table as of a version from 3 days ago using time travel and receives an error. Which THREE statements correctly explain this situation and how to prevent it in the future?

Select THREE.

Select 3 answers.

Show answer & explanation

Correct answers: B, C, E

  • B. If the team runs VACUUM with RETAIN 0 HOURS (or a retention shorter than 3 days), time travel to a 3-day-old version will fail because the underlying Parquet files have been deleted.
  • C. Setting the table property delta.deletedFileRetentionDuration = 'interval 30 days' ensures that VACUUM will not delete files still needed for time travel within 30 days.
  • E. To query a 3-day-old version, the data files must still exist on disk; VACUUM deletes physical files, and once deleted they cannot be recovered from the Delta transaction log alone.

Option B is correct: VACUUM with an explicitly reduced retention (e.g., RETAIN 0 HOURS, bypassing the safety check) deletes files that may still be referenced by older table versions, breaking time travel for those versions. Option C is correct: delta.deletedFileRetentionDuration controls the minimum age of deleted (dereferenced) data files before VACUUM can remove them; setting it to 30 days ensures files needed for 3-day-old time travel are preserved. Option E is correct: time travel requires the physical Parquet data files to exist on storage — the Delta log tracks metadata (file paths, statistics), but if the files are physically deleted by VACUUM, the data is unrecoverable from the log alone. --- Option A is misleading/wrong in this scenario: the default is 7 days, which would normally protect a 3-day query, BUT the question states the error is occurring, implying the default was overridden (as described in B) — so A does not explain the failure. Option D is wrong: delta.logRetentionDuration preserves the transaction log entries (enabling time travel version lookups) but does NOT prevent VACUUM from deleting the underlying data files; both properties must be set appropriately. Option F is wrong: DESCRIBE HISTORY shows the audit log of table operations and is read-only; it does not restore deleted files or make previously vacuumed versions queryable.

Question 8 · Data Transformation, Cleansing, and Quality

In a Delta Live Tables (DLT) pipeline, a data engineer wants to enforce data quality by preventing records with a NULL order_id from ever being written to a table, and also capture a count of how many records were rejected for monitoring purposes. Which DLT expectation syntax achieves BOTH goals?

Show answer & explanation

Correct answer: D

  • D. @dlt.expect_or_drop('valid_order_id', 'order_id IS NOT NULL') — records failing the constraint are dropped and counted in the pipeline event log.

expect_or_drop drops records that violate the constraint and records the violation counts in the DLT pipeline event log (accessible via the pipeline UI and system tables), satisfying both requirements. Option C is wrong because @dlt.expect (warn mode) does NOT drop records — it allows all records through and only logs a warning count; it does not prevent invalid data from being written. Option A is wrong because expect_or_fail halts the entire pipeline when any record violates the constraint; while it does count violations, stopping the pipeline is far more disruptive than the requirement calls for and does not simply reject individual records. Option B is wrong because expect_all is a convenience wrapper for applying multiple expectations at once (using warn semantics by default); it does not quarantine records into a separate system table — there is no such automatic quarantine behaviour in DLT.

Question 9 · Data Sharing and Federation

A company must securely share a set of Delta tables with an external partner organization WITHOUT copying the data or granting access to its whole workspace. Which Databricks capability enables this?

Show answer & explanation

Correct answer: A

  • A. Delta Sharing

Delta Sharing is an open protocol for securely sharing live data across organizations and platforms without copying it. Auto Loader (B) ingests files, cluster policies (C) govern compute, and OPTIMIZE ZORDER (D) is a performance operation.

Question 10 · Monitoring and Alerting

A data engineering team wants to monitor Databricks cluster CPU and memory utilization using Ganglia. A team member claims that Ganglia metrics are available for all cluster types in Databricks. Which statement BEST describes the availability of Ganglia metrics in Databricks?

Show answer & explanation

Correct answer: A

  • A. Ganglia is available on all Databricks cluster types (all-purpose and job clusters) as a built-in monitoring tool and is enabled by default, accessible from the Metrics tab in the cluster UI

Ganglia is a built-in cluster monitoring tool enabled by default on all Databricks clusters (both all-purpose and job clusters). It is accessible via the Metrics tab on the cluster detail page and provides real-time and historical views of CPU, memory, network I/O, and disk metrics for the driver and all worker nodes. Option C is incorrect because Ganglia is enabled by default, not opt-in. Option D is incorrect in claiming Ganglia is unavailable for job clusters—it is available on job clusters as well. Option B is incorrect; while Databricks has expanded Prometheus and Datadog integrations, Ganglia has not been fully removed or deprecated in current Databricks Runtimes as of the DE-Professional-2024 exam scope.

Question 11 · Monitoring and Alerting

A data engineer is analyzing the Databricks SQL Query History for a weekly reporting job. They identify a query that consistently takes 18–22 minutes and want to determine whether the slowness is caused by warehouse cold start, queue wait time, or actual query execution time. Which combination of metrics from the Query History detail view provides the information needed to isolate the root cause? (Select TWO)

Select 2 answers.

Show answer & explanation

Correct answers: C, E

  • C. Bytes read from cloud storage and the query's execution plan (Query Profile)
  • E. Time spent in queue (time from query submission to when execution began) and warehouse start time relative to query submission

To isolate whether slowness is due to cold start, queue wait, or execution: (E) The queue wait time (time between submission and execution start) distinguishes queue delays from execution time; the warehouse start time relative to submission identifies cold start overhead. (C) Bytes read from cloud storage combined with the Query Profile (execution plan with per-node timing) pinpoints whether the slowness is within the query execution itself—e.g., a full table scan or a skewed join. Option D (compilation time and output rows) can indicate plan complexity but does not directly isolate the three phases. Option B (concurrent queries and auto-stop setting) provides useful context but does not directly measure queue wait or execution time from the Query History view. Option A (Photon status and result caching) are relevant performance factors but do not help isolate cold start vs. queue vs. execution.

Question 12 · Cost and Performance Optimization

A Delta table suffers from the 'small files problem' after many streaming micro-batches. Which operation compacts small files into larger ones?

Show answer & explanation

Correct answer: A

  • A. OPTIMIZE (file compaction), or enabling auto-compaction/optimized writes

OPTIMIZE compacts many small files into fewer larger ones (and optimized writes/auto-compaction prevent them), improving read performance. DELETE (B) removes rows, a broadcast join (C) is a query technique, and adding columns (D) doesn't address small files.

Question 13 · Cost and Performance Optimization

Which Databricks feature accelerates query execution using a vectorized, native engine to reduce cost per query?

Show answer & explanation

Correct answer: D

  • D. Photon

Photon is Databricks' vectorized native execution engine that speeds up SQL/DataFrame workloads, improving price/performance. VACUUM (C) is file cleanup, Delta Sharing (B) shares data, and widgets (A) parameterize notebooks.

Question 14 · Cost and Performance Optimization

Queries filtering a large Delta table on a high-cardinality column (e.g., user_id) are slow because they scan many files. Which Delta optimization improves data skipping for that column?

Show answer & explanation

Correct answer: B

  • B. OPTIMIZE with ZORDER BY on the frequently filtered column

OPTIMIZE ... ZORDER BY co-locates related data and improves file-level data skipping for the specified column, reducing files scanned. VACUUM (C) removes old files (and zero retention is dangerous), CSV (A) loses Delta features, and disabling statistics (D) worsens skipping.

Question 15 · Ensuring Data Security and Compliance

A data engineering organization uses Unity Catalog and wants to understand the full data lineage of their gold.revenue_summary table, which is populated by a Delta Live Tables pipeline that reads from silver.transactions and silver.fx_rates. A new analyst asks: which Unity Catalog capabilities and/or system tables can be used to programmatically retrieve this column-level lineage? (Select TWO)

Select 2 answers.

Show answer & explanation

Correct answers: B, C

  • B. Use the Unity Catalog Lineage API (GET /api/2.0/lineage-tracking/column-lineage) to retrieve upstream column sources for a specific column in gold.revenue_summary.
  • C. Query system.access.column_lineage (part of the Unity Catalog system tables) to retrieve column-level lineage events captured during pipeline execution.

Options B and C are correct. Unity Catalog provides two complementary programmatic ways to access lineage: (1) The Lineage Tracking REST API (/api/2.0/lineage-tracking/column-lineage and /table-lineage) allows querying upstream and downstream lineage for specific tables or columns — this is suitable for integration with external governance tools. (2) system.access.column_lineage is a Unity Catalog system table that records column-level lineage events (source column → target column mappings) captured during query and pipeline execution, enabling SQL-based lineage analysis.

Option A is incorrect: system.access.audit records access and operational events (who ran what, when) but does not contain data lineage mappings. There is no action_name = 'lineageTracked' event type in the audit log.

Option D is incorrect: While system.access.table_lineage does exist as a Unity Catalog system table for table-level lineage, this option pairs it with system.access.column_lineage — which is valid — but table_lineage alone is not the answer for column-level lineage. Option D by itself only addresses table-level lineage and the question asks for column-level. However, system.access.column_lineage in option C already covers the column-level use case, making C+B the best pair.

Option E is incorrect: Delta Lake transaction logs record data operations (adds, removes, schema changes) but do not embed column-level lineage provenance metadata. Lineage is tracked by Unity Catalog's lineage engine, not in the Delta log format itself.

Question 16 · Ensuring Data Security and Compliance

A data engineering team is using Unity Catalog and wants to query the audit trail to determine which service principal ran a specific CREATE TABLE statement in the gold catalog over the last 7 days. They plan to query system.access.audit. Which query BEST retrieves this information?

Show answer & explanation

Correct answer: C

  • C. SELECT event_time, user_identity, request_params FROM system.access.audit WHERE action_name = 'createTable' AND request_params:catalogName = 'gold' AND event_time >= current_timestamp() - INTERVAL 7 DAYS;

Option C is correct. In the Databricks system.access.audit table, Unity Catalog DDL operations like creating tables are recorded with action_name = 'createTable' (camelCase, matching the UC API action name). The request_params column is a JSON-typed column (or MAP) that can be queried using the colon (:) operator for nested field extraction — request_params:catalogName extracts the catalog name. Filtering by this combination correctly identifies CREATE TABLE events in the gold catalog.

Option D is incorrect: The action_name for table creation in Unity Catalog audit logs is createTable (camelCase), not 'CREATE TABLE' (SQL syntax uppercase). The SQL DDL text is not the audit log action name.

Option B is incorrect: commandSubmit captures notebook/cluster command submissions at the workspace level, not Unity Catalog DDL operations. Parsing SQL text from request_params LIKE '%CREATE TABLE%' is unreliable and would not capture Unity Catalog API-level table creation events.

Option A is incorrect: service_name = 'dataSecurity' is not the correct service name for Unity Catalog operations. The service name for Unity Catalog in audit logs is unityCatalog. Additionally, tableCreate is not the standard action name.

Question 17 · Data Governance

To help users discover and classify data (e.g., mark columns as containing PII) in a governed way, which Unity Catalog feature is used?

Show answer & explanation

Correct answer: A

  • A. Tags (classification metadata) on catalogs, schemas, tables, and columns

Unity Catalog tags let you classify and label objects/columns (e.g., PII) to aid discovery and governance. Cluster policies (D) govern compute, widgets (C) parameterize notebooks, and COPY INTO (B) ingests data.

Question 18 · Debugging and Deploying

An organization uses Delta Live Tables (DLT) for their ingestion pipeline. After a bad deployment introduced a data quality issue, they want to roll back the pipeline's output tables to their state from 48 hours ago. Which approach is MOST appropriate?

Show answer & explanation

Correct answer: D

  • D. Use Delta time travel to query each output table AS OF a timestamp 48 hours ago and overwrite the current tables with that historical data.

Delta time travel allows querying a Delta table's state at a specific point in time using VERSION AS OF or TIMESTAMP AS OF. By reading the table at the desired historical timestamp and overwriting the current table, the rollback is achieved precisely. This is the correct rollback strategy for Delta-based pipelines. Option A (delete and recreate) would work only if a separate backup exists, which is not mentioned, and causes unnecessary downtime. Option C is a fabricated UI feature; DLT does not have a 'Restore Pipeline State' button. Option B is incorrect because a full refresh re-processes source data from scratch using the current pipeline code; reverting the code and running a full refresh would regenerate data using the old logic but would not restore historical data quality — it would reflect the source data as it currently exists.

Question 19 · Debugging and Deploying

A senior data engineer is reviewing a bundle.yml for a project that promotes from dev to prod. The bundle defines the following:

bundle:
  name: etl_pipeline
variables:
  max_retries:
    default: 1
targets:
  dev:
    mode: development
  prod:
    mode: production
    variables:
      max_retries: 3

A developer runs databricks bundle deploy --target dev. What value will max_retries resolve to during this deployment, and why?

Show answer & explanation

Correct answer: D

  • D. 1, because the dev target does not override max_retries, so it inherits the top-level default value of 1

In Databricks Asset Bundles, variables declared at the top level with a default value are used unless a specific target overrides them in its variables block. The dev target has no variables block, so max_retries resolves to its default value of 1. Option C is wrong—YAML is not parsed last-wins for sibling keys at different levels; target-level variables are scoped to their target. Option A is incorrect; mode: development affects resource naming and permissions (e.g., prepending the user name to job names) but does not reset variable values to zero. Option B is incorrect; variables with defaults are optional to override per target.

Question 20 · Data Modeling

A data engineer is building a Silver layer Delta table that consolidates records from three Bronze sources. They need to enforce the following data quality rule using Delta Live Tables: records where patient_age is NULL or negative must be dropped, and the pipeline must fail if more than 5% of records in any microbatch violate this rule. Which DLT expectation syntax achieves this?

Show answer & explanation

Correct answer: D

  • D. CONSTRAINT valid_age EXPECT (patient_age IS NOT NULL AND patient_age >= 0) ON VIOLATION FAIL UPDATE

The requirement has two parts: drop violating rows AND fail the pipeline if violations exceed a threshold. FAIL UPDATE causes the pipeline to fail when the expectation is violated, which satisfies the hard-stop requirement. However, note that standard DLT does not natively combine DROP ROW with FAIL UPDATE in a single constraint—FAIL UPDATE alone stops the pipeline on any violation, which is the closest native mechanism for a hard breach threshold. Option B uses DROP ROW, which silently removes bad records without failing the pipeline, so the '>5% fail' requirement is not met. Option C requires a non-existent 'alert threshold' configuration that is not a standard DLT feature. Option A is incorrect because omitting ON VIOLATION defaults to WARN (logging the violation) rather than dropping rows or failing.

Pick an answer on each question to check it. 20 questions in this test.

291 more Databricks Data Engineer Professional questions

Sign up free to start practising, or subscribe (from $4.97/mo) for the full 311-question bank, flashcards and timed mock exams.

Databricks Data Engineer Professional course overview and study guides →