Courseiva

Databricks Certified Data Engineer Professional (Databricks-DE-Pro) — Questions 1–75

267 questions total · 4pages · All types, answers revealed

Page 1 of 4

Page 2
1
Multi-Selecthard

A data engineer is tasked with reducing compute costs for an interactive SQL analytics workspace that runs sporadic, highly unpredictable queries. The jobs experience cold start delays and occasional out-of-memory errors due to sudden concurrency spikes. Which TWO strategies should the engineer implement to balance cost efficiency and performance?

Select 2 answers
A.Configure single-node clusters with maximum autoscaling limits to handle unpredictable concurrency peaks without cluster management overhead.
B.Migrate interactive SQL workloads to Databricks Serverless Compute to dynamically scale resources and eliminate idle billing.
C.Provision pools of pre-warmed idle driver nodes to ensure zero-second startup latency for all analytical queries.
D.Enable Photon acceleration on clusters executing heavy relational scans and complex analytical joins.
E.Disable automatic cluster termination and keep all worker nodes running 24/7 to guarantee immediate resource availability.
AnswersB, D

Serverless SQL warehouses scale automatically with query concurrency and bill only while active, directly addressing the sporadic, unpredictable workload and idle-cost constraint. Cold starts and out-of-memory errors from concurrency spikes are absorbed by dynamic resource provisioning rather than fixed cluster sizing.

Why this answer

Implementing serverless compute eliminates idle cluster costs while absorbing concurrency spikes instantly through elastic scaling. Enabling Photon on standard clusters provides vectorized query execution that speeds up scans and aggregations, reducing runtime and lowering total execution costs. Together, these choices optimize both resource utilization and user concurrency responsiveness.

Exam trap

Candidates often choose manual cluster scaling policies or standard instance types, failing to recognize that serverless compute and Photon are designed for unpredictable, high-concurrency analytical workloads.

2
MCQhard

Refer to the exhibit. Which action is the most appropriate to resolve this memory-related failure during the job execution?

A.Decrease the number of partitions using spark.sql.shuffle.partitions.
B.Upgrade the cluster to an instance type with higher memory capacity.
C.Enable autoscaling to add more nodes to the cluster.
D.Change the file format from Parquet to CSV for better performance.
AnswerB

Upgrading to a memory-optimized instance family directly addresses the physical memory constraint identified in the logs. By increasing the memory allocated to each container, the executors can accommodate the memory footprint required for the transformation, preventing the container from being killed by the underlying resource manager.

Why this answer

The error indicates an Out of Memory (OOM) condition where the container exceeded its allocated memory limit. Increasing the instance type to a memory-optimized VM size provides more RAM per executor, allowing Spark to process larger partitions without triggering the YARN memory killer. This is a common bottleneck in memory-intensive operations like wide transformations, where adjusting the cluster configuration is more effective than attempting to optimize complex query logic.

Exam trap

Candidates frequently try to solve memory errors by tuning Spark shuffle partitions or changing code logic, ignoring that an outright hardware memory ceiling requires a memory-optimized instance type.

3
MCQmedium

A data engineering team runs a nightly batch job on a Databricks job cluster. The job reads a large Parquet dataset, performs transformations, and writes the result to a Delta table. The cluster is configured with autoscaling from 4 to 16 workers and uses the default Spark configuration. The team observes that the job runs for 2 hours, but the cluster's CPU utilization is only around 30% throughout the run. They want to reduce cost without increasing runtime. Which action is most likely to achieve this?

A.Cache the Parquet dataset in memory before performing transformations.
B.Reduce the number of workers in the cluster to match the observed CPU utilization.
C.Switch the job to use Photon and increase the driver node size.
D.Enable auto-optimize shuffle and set spark.sql.shuffle.partitions to a higher value.
AnswerB

Since CPU utilization is low, the cluster is over-provisioned relative to the workload's actual parallelism. Reducing the maximum worker count lowers cost while likely maintaining similar runtime, because the job is not CPU-bound and additional workers are idle. This directly aligns compute resources with the workload's needs without changing the job logic or risking performance regression.

Why this answer

The cluster is over-provisioned because CPU utilization is low, indicating the job is not CPU-bound. Reducing the number of workers aligns compute with actual demand and lowers cost without increasing runtime. Other options either add overhead or target the wrong bottleneck, such as shuffle partitioning or driver size, which are not indicated by uniformly low CPU usage.

Exam trap

The trap here is assuming that more workers always improve performance, when in fact low CPU utilization signals over-provisioning and reducing workers is the cost-effective fix.

4
MCQhard

Which of the following describes the correct behavior of Unity Catalog's 'Data Lineage' when used for security compliance?

A.It shows which users accessed the data.
B.It captures table-to-table data dependencies.
C.It manually triggers an alert when PII is detected.
D.It permanently stores the raw data content.
AnswerB

Unity Catalog lineage maps dependencies between tables, including views and downstream transformations. This is essential for compliance, as it allows engineers to see the flow of sensitive data through the ETL pipeline, making it easier to ensure that masking policies are applied to all downstream, derived datasets.

Why this answer

Data Lineage in Unity Catalog automatically captures the flow of data from source to target. This is invaluable for security compliance, as it allows administrators to trace sensitive data across the environment, identify which tables are derived from PII sources, and understand the impact of modifying or deleting specific tables. By visualizing these dependencies, teams can ensure that security policies are consistently applied throughout the data lifecycle.

Exam trap

Test-takers often assume data lineage only tracks user access events or notebook execution history, missing that its core mechanism maps table-to-table data dependencies.

5
MCQeasy

A data engineer needs to ensure that a Databricks job can be retried automatically if it fails due to a transient cluster error. The job is configured with a maximum of 3 retries. After the third failure, the engineer wants to receive an email notification. Which feature should be used to accomplish this?

A.Set up a Databricks SQL alert on the job's run history table.
B.Configure the job to use a job cluster with autoscaling and set a retry policy.
C.Use a webhook to call an external service that sends an email.
D.Configure the job's `email_notifications` with `on_failure` and set the email address.
AnswerD

The `email_notifications` setting in a Databricks job allows you to specify email addresses to notify on failure. When combined with retries, the notification is sent after all retries are exhausted (i.e., after the final failure). This is the standard way to alert on job failure. It requires no additional infrastructure and is built into the job configuration.

Why this answer

Databricks jobs support built-in email notifications that can be triggered on failure. By configuring `email_notifications` with `on_failure`, the specified recipients receive an email after the job fails, including after all retries are exhausted. This is the most direct and native method.

Other options require external services or are not designed for this purpose.

Exam trap

The trap here is overlooking the native email notification feature and instead considering external alerting mechanisms that add unnecessary complexity.

6
MCQmedium

Refer to the exhibit. The engineer wants to replace only one specific partition in the 'orders' table. What is the best method in Databricks?

A.Run a DELETE statement for the partition and then an APPEND.
B.Use the MERGE command to overwrite only the records in the specific partition.
C.Set 'spark.databricks.delta.retentionDurationCheck.enabled' to false.
D.Enable dynamic partition overwrite mode and perform an INSERT OVERWRITE.
AnswerD

Enabling 'spark.sql.sources.partitionOverwriteMode=dynamic' allows you to replace only the partitions that exist in the write data. This is the correct, atomic, and efficient way to replace a specific date partition without affecting other partitions, making it the standard best practice for partition-level updates in Databricks.

Why this answer

Using 'partitionOverwriteMode=dynamic' with a standard INSERT OVERWRITE operation is the correct way to replace a single partition without affecting the entire table. The default behavior is 'static', which overwrites the whole table. By setting the dynamic mode, the system identifies the partitions present in the incoming data and replaces only those, ensuring minimal impact and preventing accidental data loss across the entire dataset during the overwrite process.

Exam trap

Candidates often overlook the default 'static' partition overwrite mode, which causes them to accidentally delete the entire table content when they only intended to update a single partition.

7
MCQmedium

You are monitoring a long-running Databricks job. You notice that the memory usage on the driver node is steadily increasing until it crashes. Which debugging action is most appropriate?

A.Increase the number of worker nodes in the cluster.
B.Use the Spark UI to identify tasks using 'collect()' or 'toPandas()' on large datasets.
C.Update the cluster's Spark configuration to disable the driver's log monitoring.
D.Lower the 'spark.driver.maxResultSize' setting in the cluster configuration.
AnswerB

The Spark UI allows you to inspect the execution plan and identify operations that move data from worker nodes to the driver node. Using 'collect()' on large datasets is a classic cause of driver out-of-memory errors. Identifying these bottlenecks allows you to replace them with distributed data writing.

Why this answer

Driver memory crashes are typically caused by collecting large datasets from workers to the driver. By identifying the 'collect' or 'toPandas' operations, you can optimize the code to process data in a distributed manner. This is critical for scaling data pipelines; understanding why the driver is overloaded ensures that jobs remain performant as data volumes grow and prevents common failures in production batch processing environments.

Exam trap

Candidates often suggest increasing the driver instance size as the primary solution. This ignores the root cause, which is an architectural flaw in the code pulling data into memory.

8
MCQmedium

What is the primary difference between sharing data via Delta Sharing compared to sharing data via Databricks-to-Databricks sharing?

A.Delta Sharing is only for real-time streaming data.
B.Databricks-to-Databricks sharing requires the recipient to download a credential file.
C.Delta Sharing allows recipients outside of the Databricks ecosystem to access data.
D.Databricks-to-Databricks sharing is limited to within the same cloud region.
AnswerC

Delta Sharing is an open-source protocol that decouples the data provider from the recipient's environment. This enables organizations to share data securely with partners who may be using different cloud providers or query engines, as long as they can consume the open Delta Sharing protocol via a credential file.

Why this answer

Delta Sharing is an open protocol that allows sharing data with any client, including those outside the Databricks ecosystem, by using credential files. Databricks-to-Databricks sharing is a proprietary feature that allows seamless data access across different Unity Catalog metastores within the Databricks ecosystem, leveraging built-in authentication and governance features without requiring external credential management or token distribution.

Exam trap

Candidates often assume Delta Sharing only works within the Databricks platform, confusing it with internal workspace sharing, and overlook its core capability as an open protocol for external recipients.

9
MCQhard

You are building a pipeline and notice that the 'Gold' layer tables are experiencing significant write latency due to frequent small file commits. What is the most effective way to resolve this while maintaining ACID integrity?

A.Increase the 'spark.sql.shuffle.partitions' to 5000 to distribute writes more widely.
B.Run the 'OPTIMIZE' command periodically on the Gold layer tables.
C.Switch the table from Delta format to standard Parquet files to improve write performance.
D.Use the 'vacuum' command every 5 minutes to clear out the small files.
AnswerB

The OPTIMIZE command is specifically built to compact small files in Delta tables. By running it on a schedule or as part of the pipeline, you ensure that Gold tables remain performant for readers. It is an essential maintenance task in any production-grade Delta Lake environment to ensure high-performance query execution.

Why this answer

The 'OPTIMIZE' command with 'ZORDER' is the standard way to fix the small file problem in Delta Lake. It compacts small files into larger, better-performing ones while physically organizing data to speed up reads. This is critical for Gold tables, which are typically read by BI tools.

Maintaining performance here is essential for providing end-users with a responsive, high-performance experience when accessing critical business metrics and dashboards.

Exam trap

Candidates frequently suggest vacuuming or partitioning to fix small file issues, confusing storage cleanup and partitioning strategies with the actual file compaction performed by OPTIMIZE.

10
MCQmedium

A Data Engineer is using Delta Live Tables to process a stream of user events. The `user_id` column should be unique in the target table, but the source may contain duplicate events due to retries. The engineer wants to keep only the latest event for each `user_id` based on the `event_timestamp`. Which Delta Live Tables feature should be used?

A.Use `APPLY CHANGES INTO target` with `KEYS (user_id)` and `SEQUENCE BY event_timestamp`, and set `STORED AS SCD TYPE 2`.
B.Use `@dp.expect_or_drop("unique_user", "user_id IS NOT NULL")` and then apply `dropDuplicates(["user_id"])` on the resulting DataFrame.
C.Use `APPLY CHANGES INTO target` with `KEYS (user_id)` and `SEQUENCE BY event_timestamp`, and set `STORED AS SCD TYPE 1`.
D.Use `@dp.expect_or_drop("unique_user", "row_number() OVER (PARTITION BY user_id ORDER BY event_timestamp DESC) = 1")` in a streaming table definition.
AnswerC

This configuration uses `APPLY CHANGES` to upsert records by `user_id`, keeping the latest based on `event_timestamp`. SCD Type 1 ensures only the current record is stored, so each `user_id` appears once. It handles duplicates by overwriting with the latest event, which is exactly what is needed.

Why this answer

To deduplicate and keep only the latest event per `user_id`, `APPLY CHANGES` with SCD Type 1 and a sequence column is the correct Delta Live Tables feature. It performs upserts based on the key and sequence, ensuring one row per key with the latest data. SCD Type 2 would keep history, and window functions or dropDuplicates are not suitable for streaming deduplication.

Exam trap

The trap here is attempting to use window functions or dropDuplicates for streaming deduplication, which are either unsupported or limited in streaming contexts.

11
MCQeasy

A data engineer is using Lakehouse Federation to query data from an external PostgreSQL database. The engineer has created a foreign catalog and foreign schema. Which statement accurately describes how the data is accessed during a query?

A.The query is translated into PostgreSQL SQL, executed on the external database, and the results are streamed back to Databricks for further processing.
B.The external data is cached in the Databricks workspace's local storage for the duration of the query.
C.The query is executed entirely within the external PostgreSQL database, and only the results are returned to Databricks.
D.The data is copied into Delta Lake tables in Unity Catalog before the query runs.
AnswerA

Lakehouse Federation uses query pushdown to translate parts of the query into the external database's SQL dialect, executes them remotely, and streams the results back to Databricks. Databricks then performs any remaining operations, such as joins with local data or final aggregations. This minimizes data transfer and leverages the external database's capabilities.

Why this answer

Lakehouse Federation enables querying external databases without copying data. It uses query pushdown to translate and execute parts of the query on the external system, then streams results back to Databricks for any remaining processing. This approach minimizes data movement and leverages the external database's compute.

The other options incorrectly describe data copying or full remote execution.

Exam trap

The trap here is assuming that Lakehouse Federation copies data into Databricks or executes the entire query externally, when it actually uses a hybrid pushdown approach.

12
MCQmedium

Which of the following describes the purpose of the 'Gold' layer in a Lakehouse?

A.To store the raw data in an immutable format for historical auditing.
B.To serve as a staging area for data cleaning and filtering.
C.To store business-ready data for analytical use cases.
D.To store only metadata for the entire Lakehouse architecture.
AnswerC

The Gold layer provides final, aggregated datasets that are ready for BI and reporting. By presenting data in this format, it masks the underlying complexity of the raw and silver data, providing a performant and understandable view of the business to end-users and non-technical stakeholders.

Why this answer

The Gold layer is designed for high-performance analytical queries and business intelligence. By storing data in a denormalized or star schema, and by applying business-level aggregations and business rules, this layer is the primary source of truth for downstream reporting tools. It is optimized for the needs of business users, ensuring that they can access consistent and performant data without having to perform complex joins or transformations themselves.

Exam trap

Candidates often misidentify the Gold layer as the location for raw data ingestion or initial data cleaning, confusing it with the Bronze or Silver layers where data is still evolving.

13
MCQmedium

A Data Engineer needs to ensure that a notebook job is not consuming excessive costs. Which monitoring tool provides the best view of DBU consumption per job?

A.Cluster event logs
B.Delta Live Tables event logs
C.Billable Usage System Table
D.Notebook execution history
AnswerC

The Billable Usage System Table is the authoritative source for DBU consumption metrics. It associates usage with specific jobs, clusters, and tags, making it the most effective tool for calculating the cost of specific workflows and enforcing cost management policies.

Why this answer

The Databricks Billable Usage system table tracks DBU consumption at a granular level, including by job and cluster. Analyzing this data is essential for cost governance, allowing engineers to identify inefficient workflows and optimize resource allocation. By monitoring these trends, companies can ensure their data platform remains cost-effective, preventing unexpected budget overruns and providing the data necessary to justify investments in infrastructure or job refactoring.

Exam trap

Candidates often confuse 'Billable Usage' system tables with 'Cluster Logs' or 'Query History', failing to recognize that cost-specific tracking is handled by the dedicated billing system tables.

14
MCQmedium

What is the primary advantage of using Delta Lake as the sink for your data ingestion pipelines compared to raw Parquet files?

A.Delta Lake offers faster read performance for all queries.
B.Delta Lake provides ACID transactions and schema enforcement.
C.Delta Lake is required for all streaming sources.
D.Delta Lake automatically compresses data by 90% more than Parquet.
AnswerB

ACID transactions ensure that all writes are atomic, preventing partial updates to tables. Schema enforcement ensures that only data matching the defined schema is written, preventing the 'data swamp' problem. Together, these features provide the reliability required for modern data lakehouse architectures, which is not natively available with raw Parquet.

Why this answer

The primary advantage of Delta Lake over raw Parquet is its support for ACID transactions and schema enforcement. These features prevent data corruption during concurrent writes and ensure that only clean, well-structured data enters the lake. This reliability is fundamental for enterprise data pipelines, as it eliminates common issues like partial writes, corrupted files, and downstream failures caused by unexpected schema changes, which are difficult to manage with raw Parquet.

Exam trap

Candidates frequently choose performance-related features like compression or speed as the primary benefit, ignoring that ACID transactions and schema enforcement are the foundational architectural advantages of Delta Lake.

15
Multi-Selectmedium

A data engineer is responsible for a production Databricks SQL warehouse that serves multiple teams. The engineer needs to set up monitoring to detect when query performance degrades due to resource contention. Which two metrics should the engineer monitor to identify this issue? (Choose two.)

Select 2 answers
A.The number of queries waiting in the queue for the warehouse.
B.The total storage used by the Unity Catalog metastore.
C.The number of active clusters in the workspace.
D.The number of failed login attempts to the workspace.
E.The average time queries spend in the 'RUNNING' state.
AnswersA, E

A growing queue indicates that queries are waiting for compute resources, which is a direct sign of resource contention. Monitoring the queue length helps identify when the warehouse is oversubscribed. This metric is available in the Databricks SQL warehouse monitoring dashboard and can be used to trigger alerts or scaling actions.

Why this answer

Resource contention in a SQL warehouse manifests as queries waiting in the queue and increased query execution times. Monitoring queue length and average running time provides direct insight into whether the warehouse is oversubscribed. These metrics are available in the Databricks SQL warehouse monitoring dashboard and can be used to trigger scaling or alerting.

Exam trap

The trap here is confusing general workspace metrics, such as active clusters or storage usage, with SQL warehouse-specific performance indicators that actually reveal contention.

16
MCQmedium

A Data Engineer needs to share a Delta table with a partner organization using Delta Sharing. The partner does not use Databricks. Which component must the Data Engineer generate to facilitate this secure connection?

A.A shared Unity Catalog metastore link
B.A personal access token with REST API permissions
C.A sharing credential file
D.A cross-account IAM role in the recipient's cloud
AnswerC

The sharing credential file is the fundamental mechanism for Delta Sharing. It contains the short-lived access token and the endpoint URL required by the external client to authenticate and authorize requests. This file acts as the bridge between the provider's data and the recipient's consumption tool, ensuring secure access.

Why this answer

Delta Sharing uses a credential file to authenticate external recipients. The provider generates a sharing token encapsulated in a JSON file, which the recipient imports into their Delta Sharing client. This ensures that the data provider maintains full control over access permissions while the recipient can query the data using standard tools without needing a Databricks account, maintaining a secure and decoupled architecture.

Exam trap

Candidates often mistakenly believe external non-Databricks partners need a Databricks account or shared JDBC connection strings to access Delta Sharing data.

17
MCQmedium

A Data Engineer needs to monitor the health of a Delta Live Tables (DLT) pipeline. Which metric should they monitor to track the number of data quality violations over time?

A.pipeline_latency_seconds
B.expectations_violated_records
C.cluster_cpu_utilization
D.task_retry_count
AnswerB

This metric exposes the number of records that failed a quality expectation constraint during the execution of a DLT pipeline. Tracking this count allows engineers to identify data drift or schema issues, enabling proactive remediation and ensuring that final tables meet established business quality standards.

Why this answer

The 'expectations_violated_records' metric is specifically designed to track data quality issues in DLT pipelines. By integrating these metrics with Databricks SQL alerts or external tools like Grafana, engineers can gain visibility into data lineage and quality degradation. Monitoring these metrics is essential for maintaining pipeline reliability and ensuring that downstream data consumers receive accurate and validated data, preventing the propagation of corrupted data throughout the analytical ecosystem.

Exam trap

Candidates often confuse general pipeline execution logs with specific data quality tracking metrics like expectations_violated_records when monitoring validation issues.

18
MCQhard

You are ingesting data from multiple source systems with varying file formats (JSON, CSV, Parquet) into a centralized Bronze landing zone. Which architecture pattern is the most scalable for maintaining this ingestion layer?

A.A single monolithic notebook with a massive if/else block for each source.
B.A separate ingestion pipeline or notebook for each source system.
C.Ingest everything into a single raw table before applying transformations.
D.Use a third-party tool exclusively and bypass Databricks for ingestion.
AnswerB

Isolating each source in its own pipeline allows for independent configuration, scheduling, and error handling. This modularity is essential for scalability, as it minimizes the blast radius of any individual pipeline failure and allows teams to manage and optimize ingestion logic based on the specific requirements of each source system.

Why this answer

A modular ingestion architecture that decouples source-specific logic from the common landing layer is the industry standard. By using parameterized notebooks or DLT pipelines for each source, you isolate potential failures, enable independent scaling, and simplify the management of schema mappings. This pattern ensures that changes in one source system do not impact the ingestion pipelines of others, creating a highly resilient and maintainable data acquisition ecosystem.

Exam trap

Candidates often suggest a 'monolithic' pipeline to handle all formats, failing to recognize that isolating source-specific logic is necessary for scalability and maintenance.

19
MCQmedium

When using Delta Sharing to share data with a recipient, what is the best way to handle updates to the shared data?

A.The provider must recreate the share object.
B.The recipient must request a new credential file.
C.Updates are automatically visible to the recipient.
D.The provider must run an 'REFRESH SHARE' command.
AnswerC

Because Delta Sharing queries the live Delta table, the recipient always sees the most recent committed state of the data. This provides a seamless, real-time data sharing experience, eliminating the manual overhead of exporting files or synchronizing data snapshots between the provider and the recipient organizations.

Why this answer

Delta Sharing automatically reflects the state of the table at the time of the query. Because the recipient accesses the Delta table directly (or via a managed share), any new data written to the table becomes immediately available to the recipient. There is no need for the provider to manually refresh the share, which ensures data consistency and reduces the maintenance burden for the Data Engineer.

Exam trap

Candidates often assume that Delta Sharing requires a manual 'push' or refresh mechanism to sync data, failing to realize that Delta Sharing provides a direct, live view of the underlying table.

20
MCQeasy

A data engineer has deployed a Databricks SQL dashboard that queries a gold-layer table. The dashboard is used by executives every morning. The engineer wants to be notified if the dashboard's underlying query fails or returns zero rows, which would indicate a data pipeline issue. Which Databricks feature should they use to set up this notification?

A.Databricks SQL alerts
B.Job alerts on the Databricks job that refreshes the gold table
C.Cluster metrics and logging in the Clusters UI
D.Delta Live Tables expectations
AnswerA

Databricks SQL alerts allow you to define a condition on a query result and trigger notifications when the condition is met. You can set an alert to fire if the query returns zero rows or fails, and configure email or webhook destinations. This directly addresses the need to monitor the dashboard's data freshness and query health.

Why this answer

Databricks SQL alerts are designed to monitor query results and trigger notifications based on conditions such as row count, value thresholds, or query failure. By creating an alert on the dashboard's query, the engineer can receive an email if the query fails or returns zero rows, ensuring timely awareness of data pipeline issues.

Exam trap

The trap here is confusing job-level alerts with query-level alerts; job alerts monitor execution status, while SQL alerts monitor the actual data returned by a query.

21
MCQhard

A company requires data to be physically deleted from the Bronze layer for GDPR compliance. What is the correct procedure to ensure complete removal?

A.Simply run the DELETE statement; Delta handles physical deletion automatically.
B.Run the DELETE statement and then run the VACUUM command.
C.Use the OPTIMIZE command to force the deletion of the records.
D.Overwriting the table with a filtered subset using the OVERWRITE option.
AnswerB

The DELETE command updates the Delta log to exclude the records from future reads. Running VACUUM removes the orphaned files that contain the deleted data. This combination ensures the records are both logically and physically removed from the data lake, fulfilling the legal requirements of GDPR compliance.

Why this answer

Under GDPR, 'deletion' requires the actual removal of data from all storage locations. In Delta Lake, running a DELETE statement followed by a VACUUM command is necessary. DELETE removes the records from the active state, but the underlying data files remain until VACUUM removes them.

This two-step process ensures the data is logically removed, and then physically purged from the storage provider, satisfying the right to be forgotten.

Exam trap

Candidates frequently select only the DELETE statement, forgetting that Delta Lake maintains historical versions of data files. Without VACUUM, the data remains physically present in the storage layer for recovery purposes.

22
MCQmedium

A data engineer is building a streaming ingestion pipeline from Apache Kafka to a Delta table. The pipeline must perform deduplication on a unique event_id field and handle late-arriving data. The engineer wants to use Structured Streaming with a watermark of 10 minutes. Which of the following approaches correctly implements deduplication and watermarking?

A.Use dropDuplicates with event_id and the event timestamp column without setting a watermark.
B.Use a windowed aggregation on event_id and timestamp, then filter out duplicates using row_number.
C.Use foreachBatch to manually deduplicate by querying the Delta table for existing event_id values.
D.Use dropDuplicates with event_id and set the watermark on the event timestamp column.
AnswerD

This approach correctly uses dropDuplicates on the unique event_id to remove duplicates within the watermark window. The watermark on the event timestamp column allows the stream to handle late data by tracking how late data can arrive. This is the standard pattern for deduplication in Structured Streaming with watermarking, ensuring exactly-once semantics when combined with Delta Lake.

Why this answer

The correct approach is to use dropDuplicates on the unique event_id and set a watermark on the event timestamp column. This combination allows the stream to deduplicate events within the watermark window, effectively handling late-arriving data while bounding state. It is the recommended pattern for streaming deduplication in Databricks Structured Streaming.

Exam trap

The trap here is assuming that dropDuplicates alone can handle late data without a watermark, but without a watermark, state grows indefinitely and late data may be dropped incorrectly.

23
MCQmedium

Which statement correctly describes the relationship between Unity Catalog and Databricks SQL Warehouses when using Lakehouse Federation?

A.The SQL Warehouse performs the data ingestion into the Unity Catalog metastore.
B.The SQL Warehouse pushes down query predicates to the external database.
C.Unity Catalog must store the external data in a managed Delta table.
D.All federated queries are executed solely within the Databricks control plane.
AnswerB

A key benefit of Lakehouse Federation is query pushdown. The SQL Warehouse optimizes the execution plan by sending filters, aggregations, and joins to the external database engine. This reduces data movement across the network and leverages the external database's compute power, significantly improving query performance for federated sources.

Why this answer

Lakehouse Federation allows users to query external databases directly from Databricks SQL Warehouses. The SQL Warehouse acts as the compute engine that translates Spark SQL queries into the native dialect of the external source. Unity Catalog acts as the central governance layer that stores the connection information, credentials, and schema mapping, allowing users to query external data as if it were local tables.

Exam trap

Candidates often think the data is copied into Databricks first, missing that Lakehouse Federation allows pushdown execution directly against the source database.

24
MCQeasy

Which Databricks feature should be used to gain observability into access patterns and security events across the entire workspace?

A.Delta Live Tables (DLT) logs
B.Job run history
C.System tables (Audit logs)
D.Cluster event logs
AnswerC

System tables store audit records for all user and system activities in the Databricks environment. They are the authoritative source for monitoring access patterns, ensuring compliance with security requirements, and identifying potential anomalies or security incidents across the entire Databricks workspace ecosystem.

Why this answer

System tables (specifically the audit log system table) provide comprehensive logs of all activities within a Databricks account. These tables allow engineers and security teams to monitor access patterns, identify unauthorized actions, and perform compliance reporting. Using system tables is critical for maintaining an audit trail, detecting potential threats, and ensuring that workspace operations adhere to organizational security policies and data governance standards.

Exam trap

Candidates often suggest using 'workspace logs' or manual audit scripts. They miss that 'System Tables' are the official, centralized, and queryable source of truth for all workspace-wide security events.

25
MCQhard

A Data Engineer is using Delta Live Tables to process a streaming source that contains duplicate records based on an 'event_id'. The engineer needs to ensure that only the latest record for each 'event_id' is retained in the target table, and the pipeline should handle late-arriving data. Which DLT feature should be used?

A.Use Delta Lake's MERGE INTO with a window function to rank records
B.Create a materialized view with a GROUP BY event_id and MAX(timestamp)
C.Use a streaming live table with a foreachBatch function to manually deduplicate
D.Apply changes with deduplication using the APPLY CHANGES API with a sequence column
AnswerD

The APPLY CHANGES API (formerly APPLY CHANGES INTO) supports deduplication by specifying a sequence column (e.g., event timestamp) and a key (event_id). It ensures only the latest record per key is retained, handling late-arriving data by ordering on the sequence column. This directly meets the requirement.

Why this answer

The APPLY CHANGES API in DLT is designed for change data capture and deduplication. By specifying a key column and a sequence column, it ensures that only the latest record for each key is retained, even with late-arriving data. This declarative approach simplifies pipeline code and leverages DLT's built-in handling of streaming data and state management.

Exam trap

The trap here is assuming that a simple MERGE or aggregation can handle late-arriving data; only the APPLY CHANGES API provides native sequencing and deduplication for streams.

26
MCQmedium

Which capability is provided by Databricks' integration with cloud-native monitoring tools (e.g., CloudWatch, Azure Monitor)?

A.Automated data quality remediation.
B.Centralized metrics collection and dashboarding.
C.Direct execution of SQL queries on the warehouse.
D.Fine-grained control over Spark session configurations.
AnswerB

Cloud-native monitoring tools like CloudWatch or Azure Monitor ingest platform-wide metrics. They allow for the creation of unified dashboards that display Databricks performance alongside other cloud services, providing a comprehensive operational view for site reliability engineers.

Why this answer

Integrating Databricks with cloud-native monitoring provides a unified view of platform health. These tools aggregate logs and metrics from across the entire cloud environment, allowing for centralized dashboarding and advanced alerting. This integration is vital for enterprises maintaining a 'single pane of glass' strategy, as it ensures that Databricks infrastructure metrics are treated with the same governance and visibility standards as other cloud resources.

Exam trap

Candidates often think cloud-native tools replace Databricks monitoring. They fail to recognize that the integration is for aggregation and centralized dashboarding, not for replacing Databricks' internal observability features.

27
MCQeasy

A Data Engineer is tasked with cleaning a dataset in Databricks. The dataset contains a column 'phone_number' with various formats, including parentheses, dashes, and spaces. The engineer needs to standardize all phone numbers to a digits-only format (e.g., '1234567890'). Which approach is most efficient and scalable?

A.Use a Python UDF with the re.sub() method to strip non-digit characters.
B.Use the translate() function to replace parentheses and dashes with empty strings.
C.Use the regexp_replace() function in Spark SQL to remove all non-digit characters.
D.Use the split() function to split on non-digit characters and then concatenate the parts.
AnswerC

regexp_replace() is a built-in Spark SQL function that can remove all non-digit characters from a string using a regular expression like '[^0-9]'. It operates in a distributed manner, making it efficient for large datasets. This is the simplest and most scalable approach for standardizing phone numbers.

Why this answer

regexp_replace() is a built-in, distributed function that efficiently removes all non-digit characters in one step. It leverages Spark's optimized execution engine and is the most scalable and straightforward method for this cleansing task. Other options involve less efficient UDFs, incomplete character replacement, or complex splitting logic.

Exam trap

The trap here is opting for a Python UDF because it seems familiar, but UDFs are slower and should be avoided when built-in functions suffice.

28
MCQhard

A data engineer is managing a Delta Share that includes a table with frequent updates. The engineer wants to ensure that recipients always see the latest version of the data without manual intervention. Which statement is correct regarding how Delta Sharing handles updates to shared tables?

A.Recipients must manually refresh their local copy of the shared table to see updates.
B.Updates are automatically propagated to recipients, and they see the latest data on their next query.
C.The shared table is versioned, and recipients must specify a version to query; otherwise, they see the initial snapshot.
D.Recipients receive change data capture (CDC) streams and must apply them to a local table.
AnswerB

Delta Sharing serves the current version of the shared table at query time. When the provider updates the table, the changes are immediately available to recipients on their next query. No manual action is needed. This is a key benefit of Delta Sharing: it provides live access to the latest data without copying or synchronization.

Why this answer

Delta Sharing provides live access to the shared table's current state. When the provider updates the table, recipients automatically see the changes on their next query without any manual refresh or CDC application. This is because the Delta Sharing server reads the latest Delta transaction log and serves the current snapshot.

The other options incorrectly suggest manual steps or default to stale data.

Exam trap

The trap here is assuming that recipients must refresh or apply CDC to see updates, when Delta Sharing actually serves the latest data on each query.

29
MCQmedium

You are using the Databricks CLI to automate workspace tasks. Which THREE of the following statements correctly identify capabilities of the Databricks CLI?

A.The CLI can be used to execute arbitrary SQL queries on a SQL Warehouse.
B.The CLI can manage and deploy Databricks Asset Bundles (DABs).
C.The CLI supports authentication via PATs (Personal Access Tokens) or OAuth.
D.The CLI can directly modify the contents of a Delta table.
E.The CLI can export and import workspace objects like notebooks and folders.
AnswerB, C, E

Databricks Asset Bundles are managed directly through the Databricks CLI. This functionality allows developers to package and deploy their entire data projects, including code, pipelines, and infrastructure, in a consistent and repeatable manner, which is the cornerstone of modern Databricks application development and deployment cycles.

Why this answer

The Databricks CLI is a powerful tool for DevOps integration and workspace automation. It provides a programmatic interface for interacting with the Databricks control plane, enabling developers to manage notebooks, clusters, and jobs without relying on the GUI. Mastering the CLI is essential for implementing CI/CD pipelines, automating infrastructure deployment via Terraform, and managing large-scale workspace resources efficiently within a professional Databricks environment.

Exam trap

Candidates often think the CLI is only for running commands or that it cannot handle authentication methods like OAuth, leading them to exclude valid, powerful features of the tool.

30
MCQmedium

A Data Engineer is building a Structured Streaming pipeline that reads from a Kafka topic and writes to a Delta table. The pipeline must handle late-arriving data up to 2 hours and produce correct aggregations per 10-minute window. The engineer wants the streaming query to automatically clean up old state so the job does not accumulate unbounded state. Which combination of Structured Streaming features should be used?

A.Use a tumbling window of 10 minutes with a watermark of 2 hours on the event-time column, and set the output mode to append.
B.Use a sliding window of 10 minutes with a watermark of 10 minutes on the event-time column, and set the output mode to update.
C.Use a tumbling window of 10 minutes with a watermark of 2 hours on the processing-time column, and set the output mode to append.
D.Use a tumbling window of 2 hours with a watermark of 10 minutes on the event-time column, and set the output mode to complete.
AnswerA

A watermark of 2 hours allows late data up to that bound, and tumbling windows of 10 minutes produce per-window aggregates. Append mode emits a window result only after the watermark passes the window end, and Spark automatically drops state older than the watermark, preventing unbounded state growth.

Why this answer

To handle late data up to 2 hours while producing 10-minute aggregations and bounded state, the pipeline needs event-time tumbling windows of 10 minutes and a watermark of 2 hours. Append mode emits a window result only after the watermark exceeds the window end, and Spark automatically evicts state older than the watermark, keeping state size proportional to the lateness bound rather than the entire stream history.

Exam trap

The trap here is confusing window duration with watermark duration or using processing time instead of event time, which would either drop valid late data or fail to clean up state correctly.

31
MCQeasy

A data engineer needs to audit which users have accessed a Unity Catalog table containing sensitive data. They want to see a record of all queries that read from the table over the past 30 days. Which Unity Catalog feature should they use?

A.Delta transaction log
B.Data lineage
C.Information schema
D.Audit logs
AnswerD

Audit logs capture detailed information about user activities, including queries executed against Unity Catalog tables. They record who accessed what data and when, making them the correct choice for auditing access to sensitive tables. Audit logs are stored in the metastore's storage location and can be queried for analysis.

Why this answer

Audit logs in Unity Catalog record all access and query activities, including the user, timestamp, and the tables accessed. They are essential for security auditing and compliance. Data lineage, information schema, and Delta transaction logs serve different purposes and do not provide a record of user access.

Exam trap

The trap here is assuming data lineage tracks user access, but it only tracks data flow, not individual queries.

32
MCQmedium

A financial services firm maintains a Delta Lake table of account transactions that must support both current-state queries and full audit history of every change, including corrections that arrive days later. Regulators require the ability to query the table as it existed at any prior date. Which Delta Lake capability should the engineer rely on to satisfy the audit requirement?

A.Time travel using the transaction log to query historical versions of the table by version number or timestamp
B.Relying on the underlying cloud object store's versioning to recover previous Parquet files
C.Maintaining a separate archive table populated by a nightly full copy of the transactions table
D.Enabling Change Data Feed to capture row-level changes and querying the feed instead of the table
AnswerA

Delta Lake records every commit in the transaction log, so time travel can reconstruct the table as of a specific version or timestamp, directly satisfying the requirement to query prior states. Corrections create new versions rather than destroying old ones, so auditors can retrieve the exact state at any retained point in time using the same table.

Why this answer

Delta Lake's transaction log records each commit atomically, enabling time travel to any retained version or timestamp. Because late corrections create new versions while prior versions remain queryable, auditors can reconstruct the exact table state at a prior date, which is precisely what the regulatory requirement demands.

Exam trap

The trap here is treating Change Data Feed as a historical snapshot mechanism, when it only surfaces row-level change records rather than a complete reconstructable table state at an arbitrary point in time.

33
MCQmedium

A data engineer needs to restrict access to personally identifiable information (PII) columns in a Unity Catalog table for a group of analysts. Which Unity Catalog feature should be used to enforce this policy while ensuring data remains queryable?

A.Apply a static mask using a custom UDF during data ingestion.
B.Grant the analyst group SELECT access on the table and instruct them to cast PII columns to null.
C.Define a column mask using SQL functions to redact data for the analyst group.
D.Create separate physical tables for analysts containing only non-sensitive columns.
AnswerC

Unity Catalog column masking allows engineers to apply granular security policies directly to table columns. By defining a mask, the platform automatically redacts data based on the user's role at query time, ensuring compliance without modifying the underlying storage. This provides a clean separation between data storage and security enforcement.

Why this answer

Dynamic views or Row-level security (RLS) and Column-level security (CLS) are essential for compliance. By utilizing SQL functions like current_user() within a defined mask, you ensure that PII is obscured based on user identity. This approach centralizes security within the data platform, preventing the need to duplicate datasets for different access levels, which significantly reduces the administrative burden and minimizes the risk of unauthorized data exposure in production environments.

Exam trap

Candidates often suggest creating separate views for each user role. This leads to 'view explosion,' which is difficult to maintain and audit compared to centralized column masking.

34
MCQmedium

A data engineer is ingesting data from an Apache Kafka topic into a Delta Lake table using Structured Streaming. The Kafka topic receives messages with a timestamp field in the value payload, but the ingestion must handle late-arriving data and produce correct aggregations. The engineer wants to ensure that watermarks are applied correctly. Which approach should be used?

A.Use the Kafka timestamp column provided by the Kafka source, and apply a watermark on that column.
B.Use the current_timestamp() function to generate a processing-time column and apply a watermark on that column.
C.Parse the timestamp field from the Kafka value payload, cast it to a timestamp, and apply a watermark on that column.
D.Set the Kafka source option 'startingOffsets' to 'earliest' and rely on the default watermark.
AnswerC

To correctly handle late-arriving data based on event time, the watermark must be applied on the event-time column derived from the payload. Parsing the timestamp field, casting it to a timestamp type, and then applying a watermark on that column allows Structured Streaming to track event time and drop or update late data according to the watermark threshold. This is the standard approach for event-time processing with Kafka and Delta Lake.

Why this answer

For correct event-time processing with Kafka and Delta Lake, the event timestamp must come from the message payload, not from Kafka metadata or processing time. Parsing that field and applying a watermark on it enables Structured Streaming to manage late-arriving data accurately. This ensures that aggregations and stateful operations reflect the true event time and that late data is handled according to the defined watermark.

Exam trap

The trap here is assuming that the Kafka timestamp or processing time can be used for watermarks, but event-time watermarks must be based on the actual event timestamp from the payload.

35
Multi-Selecthard

A data engineer is building a streaming ingestion pipeline using Databricks Auto Loader to ingest JSON files from cloud storage into a Delta Bronze table. The pipeline must handle schema evolution without failing and must minimize the number of files that require reprocessing when the schema changes. The engineer wants to configure Auto Loader appropriately. Which two configuration settings should be used to achieve these requirements? (Choose two.)

Select 2 answers
A.Set cloudFiles.schemaLocation to a dedicated directory in cloud storage.
B.Set cloudFiles.inferColumnTypes to true.
C.Set cloudFiles.useNotifications to true.
D.Set cloudFiles.schemaEvolutionMode to 'addNewColumns'.
E.Set cloudFiles.format to 'parquet'.
AnswersA, D

The cloudFiles.schemaLocation specifies where Auto Loader stores the inferred schema and metadata about schema evolution. By providing a persistent location, Auto Loader can track schema changes over time and avoid reprocessing files that were already ingested with an older schema. This is essential for minimizing reprocessing and ensuring consistent schema management across pipeline restarts.

Why this answer

To handle schema evolution without failing and minimize reprocessing, Auto Loader must be configured to add new columns dynamically and to store schema metadata persistently. Setting the schema evolution mode to addNewColumns ensures new fields are incorporated, while specifying a schema location allows Auto Loader to track schema changes and avoid reprocessing already-ingested files. Together, these settings provide robust schema evolution with efficient incremental processing.

Exam trap

The trap here is assuming that enabling file notification or type inference alone will handle schema evolution and reduce reprocessing, when in fact schema evolution mode and schema location are the critical settings.

36
MCQmedium

You have a large Spark DataFrame that you need to filter and save as multiple smaller Parquet files based on the values in a 'region' column. Which method should you use to optimize the file layout for subsequent queries?

A.Use the 'repartition' method on the DataFrame before writing.
B.Use the 'partitionBy' option in the write command.
C.Use the 'sortWithinPartitions' method.
D.Use the 'coalesce' method.
AnswerB

The 'partitionBy' command instructs Spark to organize the output into a directory structure based on the values in the specified columns. This allows downstream queries to use partition pruning to only scan the necessary folders, significantly reducing data read and increasing query efficiency for the region data.

Why this answer

Partitioning by a low-cardinality column like 'region' physically organizes data into folders. This allows engines to perform 'partition pruning', skipping irrelevant folders during query execution. This is a standard optimization in Databricks for any dataset with clear categorical groupings, as it directly reduces the I/O cost of queries that filter by the partition key, improving performance significantly for analysts and dashboard tools.

Exam trap

Candidates frequently confuse partitionBy with clustering or bucketing. They mistakenly believe that using partitionBy will automatically optimize all query types, ignoring that it creates small file problems if the cardinality is too high.

37
MCQmedium

A Data Engineer needs to enforce a NOT NULL constraint on a specific column in a Delta table while maintaining the ability to perform high-performance streaming writes. Which approach is the most efficient and native method to ensure this data quality requirement?

A.Apply a filter transformation in the DataFrame after the data is written to the table.
B.Use an external Delta Live Tables expectation to quarantine bad records.
C.Add a CHECK constraint to the table using the ALTER TABLE ADD CONSTRAINT command.
D.Perform a manual check within the Spark Structured Streaming loop before appending to the sink.
AnswerC

The ALTER TABLE ADD CONSTRAINT command natively integrates with Delta Lake's transaction log to enforce validation at the moment of ingestion. It is highly performant and ensures that no transaction containing a null value in the specified column will be committed, effectively preventing data quality issues at the source.

Why this answer

Using Delta Lake's CHECK constraints is the most efficient way to enforce data quality at write time. By defining a constraint, the Delta engine validates every incoming row against the business logic before committing the transaction. This avoids post-process cleanup jobs, reduces storage waste, and ensures that downstream consumers always receive valid data, which is critical for maintaining robust data pipelines in a Lakehouse architecture.

Exam trap

Candidates often try to implement data quality checks using external post-processing scripts or complex notebook logic rather than utilizing native table constraints.

38
Multi-Selecthard

A Data Engineer is implementing a medallion architecture. Which THREE steps are critical for effectively implementing a high-quality 'Silver' layer from 'Bronze' data?

Select 3 answers
A.Enforce strict schema validation on incoming Bronze files.
B.Perform deduplication to ensure unique records based on business keys.
C.Apply business logic and complex transformations to create aggregate summary tables.
D.Convert all column names to uppercase to ensure case-insensitive consistency.
E.Standardize data formats (e.g., timestamps, currency codes) across all source systems.
AnswersA, B, E

Schema enforcement at the Silver layer is critical to ensure data consistency. By validating that columns match expected types and structures, you prevent downstream failures in analytical queries and reporting tools, which often lack the robustness to handle unexpected schema changes or malformed data types automatically.

Why this answer

The Silver layer is the 'single source of truth' for refined data. By applying strict schema enforcement, deduplication, and standardized data types, you ensure that analytical tools receive reliable, high-quality information. Proper implementation here prevents the 'garbage in, garbage out' scenario, allowing data scientists and analysts to focus on modeling and reporting rather than constant, redundant data cleaning tasks, significantly increasing organizational productivity and trust in data.

Exam trap

Candidates often focus only on loading data, ignoring the critical deduplication and standardization steps that distinguish the refined Silver layer from the raw Bronze layer.

39
MCQmedium

Refer to the exhibit. Why is Task D marked as 'Skipped'?

A.Task D reached its execution timeout limit before it could start.
B.Task D has a dependency on Task B, which failed.
C.The cluster running Task D was terminated by an administrator.
D.Task D was manually disabled in the job configuration.
AnswerB

The workflow engine marks tasks as 'Skipped' if they depend on an upstream task that failed. Since Task B failed, Task D, which relies on the successful completion of Task B, is automatically skipped to prevent the execution of a potentially inconsistent or broken data process.

Why this answer

In Databricks Workflows, a task is 'Skipped' if its upstream dependencies have not been met, typically because a required parent task failed. Because Task B failed, the downstream Task D—which likely depends on Task B—cannot execute. This mechanism prevents the workflow from processing invalid or incomplete data, maintaining the integrity of the data pipeline and preventing downstream failures from compounding existing upstream errors.

Exam trap

Candidates mistakenly believe a 'Skipped' task status means the task was manually disabled, confusing it with upstream dependency failures where parent task failure cascades downstream.

40
MCQmedium

When ingesting data using Auto Loader, what is the purpose of the 'cloudFiles.schemaLocation' parameter?

A.It specifies the target directory where the processed Delta table data is stored.
B.It stores metadata about the inferred schema and tracks evolution.
C.It defines the temporary directory used for shuffling large datasets during joins.
D.It is used to cache the raw JSON files before they are parsed.
AnswerB

The schema location is where Auto Loader saves the inferred schema and tracks historical changes. This allows the process to maintain state regarding the data structure, ensuring that subsequent batches are processed correctly even as the source schema changes over time across multiple runs or restarts.

Why this answer

The schema location is vital for Auto Loader because it stores the inferred schema and tracks schema evolution history. By persisting this information in a managed location, Auto Loader can resume ingestion after a job restart without re-inferring the schema from scratch. This ensures consistency and prevents potential ingestion failures caused by schema drift when processing new files in a long-running stream.

Exam trap

Candidates frequently mistake this parameter for the data storage location itself, confusing the metadata/schema tracking path with the actual raw data destination path used by Auto Loader.

41
MCQmedium

A data engineer manages a Delta table that is used for both batch analytics and frequent small updates from a streaming job. The table is not partitioned, and the engineer notices that queries are slowing down as the table grows. The engineer wants to improve query performance without changing the table schema or partitioning strategy. Which action should the engineer take?

A.Increase the cluster size used for all queries against the table.
B.Convert the table to a Parquet table and use partitioning by date.
C.Run OPTIMIZE with Z-ORDER on a commonly filtered column.
D.Enable change data feed on the table and run VACUUM with a shorter retention period.
AnswerC

Z-ORDERing during OPTIMIZE co-locates related data in the same files, improving data skipping for queries that filter on the Z-ORDERed column. This reduces the amount of data scanned and speeds up queries, especially for large tables with frequent updates. It does not require schema changes or partitioning, and it can be scheduled regularly to maintain performance as new data arrives.

Why this answer

OPTIMIZE with Z-ORDER improves data skipping by clustering similar data together, which directly speeds up queries that filter on the Z-ORDERed column. It works without schema changes or partitioning and is compatible with frequent updates. Other options either do not address query performance or introduce trade-offs that harm Delta Lake capabilities.

Exam trap

The trap here is thinking that VACUUM or adding compute solves query slowdowns, when the real fix is optimizing data layout with Z-ORDER to enable efficient data skipping.

42
MCQmedium

A Data Engineer needs to perform an 'upsert' operation on a Delta table. Which command provides the most efficient way to merge new data with existing records in a single transactional step?

A.INSERT INTO ... ON DUPLICATE KEY UPDATE
B.UPDATE target SET ...; INSERT INTO target ...
C.MERGE INTO target USING source ON condition WHEN MATCHED ...
D.OVERWRITE TABLE target SELECT * FROM source
AnswerC

MERGE INTO is the native Delta Lake SQL command for upserts. It efficiently processes updates and inserts in a single transaction. It is highly optimized for performance and ensures data integrity by utilizing the transaction log to confirm that the entire operation either succeeds as a whole or rolls back upon failure.

Why this answer

The MERGE INTO command is the standard SQL construct for performing upserts in Delta Lake. It handles both updates to existing records and the insertion of new records based on a join condition. This single, atomic statement simplifies complex logic that would otherwise require multiple steps, ensuring that the target table remains in a consistent state throughout the entire upsert operation in high-concurrency production environments.

Exam trap

Candidates often choose manual 'delete' and 'insert' operations, which are not atomic. They fail to recognize 'MERGE INTO' as the standard, efficient, and transactional way to perform upserts.

43
MCQhard

A Data Engineer is using Delta Live Tables to process a stream of financial transactions. The pipeline must ensure that each `transaction_id` appears only once in the target table, even if the source stream contains duplicates due to at-least-once ingestion. The engineer wants to use the `APPLY CHANGES` API. Which combination of settings will achieve this with minimal data loss?

A.Use `APPLY CHANGES INTO target` with `KEYS (transaction_id)` and `SEQUENCE BY timestamp`, and set `STORED AS SCD TYPE 1`.
B.Use `APPLY CHANGES INTO target` with `KEYS (transaction_id)` and omit the `SEQUENCE BY` clause, and set `STORED AS SCD TYPE 1`.
C.Use `APPLY CHANGES INTO target` with `KEYS (transaction_id)` and `SEQUENCE BY timestamp`, and set `STORED AS SCD TYPE 2`.
D.Use `APPLY CHANGES INTO target` with `KEYS (transaction_id)` and `SEQUENCE BY timestamp`, and set `STORED AS SCD TYPE 2` with `IGNORE NULLS`.
AnswerA

SCD Type 1 with `APPLY CHANGES` uses the specified keys to upsert records, keeping only the latest version based on the sequence column. This ensures each `transaction_id` appears once, with the most recent data. It handles duplicates by overwriting existing rows, which is appropriate for deduplication when the latest record is desired.

Why this answer

To deduplicate and keep only the latest record per `transaction_id`, `APPLY CHANGES` with SCD Type 1 and a sequence column is correct. SCD Type 1 performs upserts, overwriting existing rows, so each key appears once. SCD Type 2 would keep history, resulting in multiple rows.

The sequence column ensures the latest record is applied deterministically.

Exam trap

The trap here is assuming that SCD Type 2 is needed for deduplication, when in fact it preserves history and creates multiple rows per key.

44
Multi-Selectmedium

Which TWO of the following are valid ways to pass configuration parameters to a Databricks Job task? (Select TWO)

Select 2 answers
A.Using dbutils.widgets.text to read parameters injected via the Job UI.
B.Hardcoding the variables in a global configuration class.
C.Passing parameters via the 'parameters' field in the Task configuration.
D.Using a temporary local file to store configuration values.
E.Reading directly from the user's home directory path.
AnswersA, C

Notebooks can utilize dbutils.widgets to capture parameters defined in the Job task configuration. This allows users to create interactive reports or parameterized pipelines where values can be passed at runtime, enabling high reusability of the same notebook across different environments or for various time-windowed data processing tasks.

Why this answer

Databricks Jobs offer multiple ways to parameterize tasks. Using task-level parameters allows for dynamic behavior without changing code. CLI options and the Job API are standard methods for injecting these values.

Understanding these mechanisms is essential for creating reusable, modular pipelines that can adapt to different environments or data sources without hardcoding variables directly into the notebook or Python scripts.

Exam trap

Many candidates confuse 'parameters' with 'environment variables' or 'spark configuration'. They mistakenly select options involving setting Spark configs globally instead of task-specific parameter injection methods.

45
MCQhard

A data engineer is configuring a Unity Catalog external location to allow a service principal to write to an ADLS Gen2 container. The storage credential uses a managed identity. The engineer grants the service principal `WRITE FILES` on the external location. However, when the service principal attempts to write, it fails with a permissions error. The engineer verifies that the managed identity has the Storage Blob Data Contributor role on the container. What is the most likely cause of the failure?

A.The service principal does not have the `USE EXTERNAL LOCATION` privilege on the external location.
B.The service principal lacks the `CREATE EXTERNAL TABLE` privilege on the external location.
C.The external location is missing the `READ FILES` privilege for the service principal.
D.The managed identity lacks the Storage Blob Data Reader role on the container.
AnswerA

In Unity Catalog, to use an external location, a principal must have the `USE EXTERNAL LOCATION` privilege in addition to any file-level privileges like `WRITE FILES`. Without `USE EXTERNAL LOCATION`, the principal cannot access the external location at all, even if it has `WRITE FILES`. The managed identity's cloud permissions are separate and do not grant Unity Catalog access.

Why this answer

Unity Catalog requires both `USE EXTERNAL LOCATION` and the appropriate file-level privileges (`READ FILES`, `WRITE FILES`) to access data in an external location. The `USE EXTERNAL LOCATION` privilege grants the ability to reference the external location in queries and commands, while `WRITE FILES` allows writing data. Without `USE EXTERNAL LOCATION`, the service principal cannot utilize the external location, resulting in a permissions error despite having `WRITE FILES` and cloud storage permissions.

Exam trap

The trap here is focusing on cloud IAM roles and file-level privileges while overlooking the mandatory `USE EXTERNAL LOCATION` privilege that gates access to the external location itself.

46
MCQeasy

A data engineer is configuring audit logging for a Unity Catalog-enabled workspace. The security team wants to capture all access to tables and the granting of privileges. Which Databricks feature should the engineer enable to collect these audit events?

A.Workspace access control lists (ACLs).
B.Diagnostic log delivery to a cloud storage location.
C.Delta Live Tables event log.
D.Unity Catalog data lineage.
AnswerB

Databricks diagnostic logs include audit logs that record Unity Catalog data access and privilege changes. Delivering these logs to cloud storage such as S3, ADLS, or GCS allows the security team to retain and analyze them. This is the standard mechanism for capturing audit events for compliance, and it covers table access and GRANT/REVOKE operations.

Why this answer

Databricks audit logs, delivered through diagnostic log delivery, capture Unity Catalog data access and privilege changes. They are the authoritative source for security auditing and compliance. Other features like Delta Live Tables event logs, data lineage, and workspace ACLs serve different purposes and do not provide the required audit event stream.

Exam trap

The trap here is equating data lineage with audit logging, when lineage tracks data flow between objects rather than recording user access events or privilege grants.

47
MCQhard

Refer to the exhibit. A data engineer creates an instance pool to reduce cluster startup times for development teams. However, finance reports indicate unexpected cloud infrastructure charges. Based on the configuration shown in the exhibit, what is the primary driver of these unexpected costs?

A.The max_capacity limit is set too low, forcing teams to provision multiple competing instance pools.
B.Instance pools do not support Spot instances, forcing all pool-backed clusters to run expensive on-demand VMs.
C.The min_idle_instances setting maintains running virtual machines continuously, incurring persistent infrastructure costs.
D.The selected node_type_id is optimized for storage rather than compute, causing inflated licensing surcharges.
AnswerC

min_idle_instances keeps that number of virtual machines powered on at all times, even when no clusters are running. Those idle instances bill continuously for cloud infrastructure, which is the persistent cost driver behind the unexpected charges shown in the exhibit.

Why this answer

Instance pools maintain idle virtual machines ready for immediate attachment to clusters, drastically reducing startup latency. However, setting min_idle_instances to 2 ensures that two instances are running constantly even when no clusters are active, incurring continuous cloud provider infrastructure charges and idle DBU fees that accumulate rapidly.

Exam trap

Candidates often blame 'cluster size' or 'DBU usage' for costs, missing the specific detail that 'min_idle_instances' forces the cloud provider to keep virtual machines running 24/7.

48
MCQmedium

A data engineer is optimizing a PySpark job that processes a large DataFrame and writes the result to a Delta table. The job currently uses repartition(100) before writing, but the output consists of many small files. The engineer wants to reduce the number of output files without shuffling the entire dataset again. Which approach should be used?

A.Use coalesce(10) before writing to reduce the number of partitions without a full shuffle.
B.Use partitionBy("column") to write the data into subdirectories, which reduces the number of files per directory.
C.Set spark.sql.shuffle.partitions to 10 before writing.
D.Use repartition(10) before writing to redistribute data evenly and reduce file count.
AnswerA

coalesce reduces the number of partitions by combining existing partitions without a full shuffle. It is more efficient than repartition when reducing partitions because it avoids shuffling data across the network. Using coalesce(10) would combine the 100 partitions into 10, reducing the number of output files while minimizing data movement.

Why this answer

coalesce is the correct choice because it reduces the number of partitions without a full shuffle, making it efficient for reducing output file count. repartition would cause an unnecessary shuffle, and changing shuffle partitions or using partitionBy does not achieve the goal of reducing files without a shuffle.

Exam trap

The trap here is thinking that repartition is always better for reducing file count, ignoring the shuffle cost.

49
MCQhard

A data team is using Liquid Clustering on a Delta table. How does this feature improve performance compared to traditional Z-Ordering or Partitioning?

A.It eliminates the need for any clustering keys by automatically indexing every column.
B.It automatically adjusts the data layout based on changing query patterns without manual maintenance.
C.It forces all data to be stored on a single partition to maximize local cache hits.
D.It replaces Delta Lake's file management, making the OPTIMIZE command unnecessary.
AnswerB

Liquid Clustering is designed to be adaptive. By monitoring how data is accessed, it automatically reclusters data to optimize for the most frequent queries. This removes the need for manual Z-Ordering or re-partitioning, ensuring that the table remains performant over time as query patterns evolve in production environments.

Why this answer

Liquid Clustering provides dynamic data layout optimization that automatically adapts to query patterns without requiring manual maintenance or complex partition strategies. Unlike static partitioning, which can lead to data skew or file management issues, Liquid Clustering reorganizes data based on actual usage, significantly reducing the burden on engineers. It is a more flexible, modern solution that simplifies performance tuning while ensuring that read queries remain fast across varying data access patterns.

Exam trap

Candidates frequently confuse Liquid Clustering with traditional partitioning, incorrectly believing it requires manual maintenance or specific column definitions to be set up by the user for every query pattern change.

50
MCQhard

You are managing a large-scale data lakehouse. You notice that your Spark jobs are frequently failing due to disk space issues on worker nodes. Which monitoring feature should you implement to proactively capture this trend?

A.Enable standard Databricks job success/failure notifications.
B.Set up a Databricks SQL alert on the system.query_history table.
C.Monitor Spark shuffle spill metrics using the Ganglia UI or custom Spark listeners.
D.Schedule a daily scan of the underlying S3 or ADLS storage buckets.
AnswerC

Shuffle spill metrics are the leading indicator for disk pressure in Spark. When memory is insufficient, Spark spills shuffle data to the local disk. By monitoring these metrics through Ganglia or custom listeners, you can detect early signs of performance degradation and disk usage growth, allowing you to intervene proactively.

Why this answer

Implementing custom Spark listeners or utilizing the Spark UI metrics for 'Disk Spilling' is the most effective proactive measure. Disk space exhaustion is often a symptom of memory pressure, leading to excessive shuffle operations. By monitoring spill-to-disk metrics, you can identify jobs that require more memory or better partitioning, preventing job failure and optimizing compute efficiency before the disk threshold is reached.

Exam trap

Candidates often select cluster scaling or instance resizing instead of specific metrics like shuffle spill, which directly diagnoses out-of-disk errors caused by memory pressure.

51
MCQmedium

A data engineer is designing an ETL pipeline processing high-frequency streaming data into Delta tables on Databricks. The pipeline experiences frequent small file creation and high metadata overhead, degrading query performance. Which optimization technique should the engineer implement to resolve this issue?

A.Increase the Delta table version retention period to keep historic snapshots longer.
B.Enable predictive optimization to automatically manage compaction and vacuum operations.
C.Enable spark.databricks.delta.optimizeWrite.enabled and spark.databricks.delta.autoCompact.enabled.
D.Switch the table format from Delta to Apache Parquet to leverage native cloud storage indexing.
AnswerC

Enabling optimized writes and Auto Compact forces Spark to shuffle data to achieve well-sized files prior to writing and automatically triggers a compaction pass when small files are detected. This directly targets the root cause of metadata bottlenecks in high-frequency streaming architectures.

Why this answer

Implementing automated compaction via optimized write and Auto Compact merges small files during writes, maintaining optimal file sizes around 128MB. This technique is critical for streaming workloads because frequent micro-batches naturally produce excessive tiny files that severely degrade both metadata listing times and subsequent read scan performance across production environments.

Exam trap

Many candidates select periodic manual OPTIMIZE commands rather than automatic write-time solutions, missing the proactive nature required for high-frequency streaming workloads.

52
MCQhard

Refer to the exhibit. A Data Engineer is attempting to merge data into a table with these constraints defined. If the incoming batch contains rows that violate these rules, what is the default behavior of the Delta Lake engine during the merge operation?

A.The engine silently ignores the invalid rows and completes the merge for valid records only.
B.The transaction fails entirely, and no changes are committed to the Delta table.
C.The invalid rows are automatically routed to a hidden sidecar table for later review.
D.The engine automatically updates the invalid rows to the default column value.
AnswerB

Constraints in Delta Lake are hard requirements. If an operation violates these rules, the commit fails, and the transaction is aborted. This guarantees that the table remains in a consistent state and prevents invalid data from entering the storage layer, which is crucial for maintaining reliable audit trails and reports.

Why this answer

Delta Lake maintains strict ACID compliance. When a transaction violates defined CHECK or NOT NULL constraints, the engine throws an error, and the entire transaction is rolled back. This behavior prevents data corruption and ensures that only valid state transitions occur.

This is essential for maintaining data integrity in complex ETL pipelines where maintaining a 'known good' state is preferred over partial updates or silent failures.

Exam trap

Candidates often believe that Delta Lake will silently drop, quarantine, or ignore invalid rows during a merge operation, missing the strict ACID transaction failure behavior.

53
MCQmedium

A data engineer wants to ensure that all data in a specific catalog is encrypted at rest. Which feature should they verify is enabled within the Unity Catalog metastore configuration?

A.Workspace-level access control lists.
B.Customer-managed keys (CMK) for managed storage.
C.Unity Catalog lineage tracking.
D.Table access control (TAC).
AnswerB

Customer-managed keys provide a mechanism to encrypt data at rest using keys managed by the customer. This is the industry-standard approach for ensuring data confidentiality in a multi-tenant cloud environment, providing an additional layer of security and auditability that is essential for enterprise compliance and robust data governance.

Why this answer

Customer-managed keys (CMK) for managed storage are the standard governance tool for ensuring that data at rest is encrypted according to organizational security policies. By configuring CMK, the organization maintains control over the encryption lifecycle, satisfying compliance requirements. This feature is critical for highly regulated industries where the entity, rather than the cloud provider, must maintain the ultimate authority over data access and encryption standards in the cloud.

Exam trap

Candidates often confuse 'encryption at rest' with 'access control' or 'data masking.' They may select options like Unity Catalog permissions, which govern access but not storage-level encryption.

54
MCQeasy

A data engineer is reviewing a Databricks job that runs on a job cluster and reads a large Delta table. The engineer notices that the job takes a long time to start because the cluster is provisioned from scratch each time. The engineer wants to reduce the startup time without increasing cost significantly. Which action should the engineer take?

A.Use a larger driver node to speed up initialization.
B.Enable cluster pools and configure the job to use a pool.
C.Set the cluster's Spark configuration to enable adaptive query execution.
D.Increase the cluster's autoscaling maximum to allow more nodes.
AnswerB

Cluster pools maintain a set of idle, ready-to-use instances that can be quickly allocated to clusters. Using a pool for the job cluster reduces startup time because the instances are already provisioned. It can also reduce cost by sharing idle instances across multiple clusters, though there is a small cost for maintaining the pool.

Why this answer

Cluster pools keep a set of idle instances ready, so job clusters can start almost instantly by borrowing from the pool. This reduces startup time significantly. The other options either do not address startup time or could increase cost without solving the problem.

Exam trap

The trap here is confusing cluster startup time with job execution time; features like AQE or larger drivers improve execution but not provisioning.

55
MCQmedium

A data engineer has a Unity Catalog managed table `sales.raw.transactions` that contains a column `customer_email` with PII. Analysts in the `marketing_analysts` group need to query the table for aggregate reporting but must never see individual email addresses. The engineer wants to enforce this dynamically without creating a separate view or copy of the data. Which Unity Catalog feature should the engineer use?

A.Create a row filter on `sales.raw.transactions` that excludes rows where `customer_email` is not null.
B.Enable attribute-based access control (ABAC) at the catalog level to automatically mask all PII columns for all non-admin users.
C.Apply a column mask to `customer_email` using a user-defined function that returns NULL for members of `marketing_analysts`.
D.Revoke SELECT on the table from `marketing_analysts` and grant SELECT only on a view that omits `customer_email`.
AnswerC

Column masks in Unity Catalog allow dynamic redaction of column values based on the querying user or group. By attaching a mask function that returns NULL for marketing_analysts, the engineer enforces the restriction at query time without altering the underlying data or creating separate views. This meets the requirement of dynamic enforcement and is applied directly to the table column.

Why this answer

A column mask in Unity Catalog applies a user-defined function at query time to transform or redact column values based on the invoking user's identity or group memberships. This allows the same table to return different values for different users without duplicating data or creating separate views. It is the native mechanism for dynamic column-level security and satisfies the requirement to hide email addresses from marketing analysts while still permitting aggregate queries.

Exam trap

The trap here is assuming that row filters can restrict columns or that revoking table access and using a view is the only way to hide sensitive columns, overlooking the dynamic column mask feature.

56
MCQmedium

Your organization runs numerous batch data engineering pipelines using standard Databricks jobs. Finance reports indicate that compute costs are inflated due to cluster startup times and rigid over-provisioning. Which optimization approach provides the best balance of cost savings and execution reliability for scheduled production batch jobs?

A.Keep using interactive all-purpose clusters but implement notebook-level python scripts to manually stop clusters when jobs finish.
B.Refactor all batch jobs to execute exclusively on Serverless SQL Warehouses regardless of workload dependencies.
C.Migrate scheduled pipeline execution to Databricks Jobs compute leveraging job clusters configured with spot instances for workers.
D.Reduce the executor memory allocation below default recommendations to force Spark to spill data to disk more frequently.
AnswerC

Databricks Jobs compute bills at a significantly lower rate than all-purpose compute. Configuring job clusters with spot instance workers leverages spare cloud capacity at steep discounts, while job orchestration automatically provisions and terminates clusters per run.

Why this answer

Transitioning scheduled production batch pipelines from interactive all-purpose clusters to Databricks Jobs compute with spot instance integration delivers massive financial savings. Jobs compute provides lower compute unit pricing compared to interactive workspaces, while spot instances discount infrastructure further, and robust retry mechanisms handle any cloud-level pre-emptions gracefully.

Exam trap

Candidates often suggest interactive clusters to avoid configuration complexity. They ignore that interactive clusters bill at higher rates and stay running, failing to leverage the cost-effective nature of job-specific compute.

57
Multi-Selectmedium

Which TWO of the following are benefits of using the Databricks Delta Lake 'Optimize' command? (Select TWO)

Select 2 answers
A.It automatically shrinks the data volume by dropping null values.
B.It compacts small files into larger, more efficient Parquet files.
C.It enables Z-Ordering for more efficient data skipping.
D.It converts Parquet files to CSV format for better compatibility.
E.It automatically updates the table statistics for the CBO.
AnswersB, C

Small files are a major performance killer in distributed systems because they cause excessive metadata operations and suboptimal I/O. By merging these into larger files, OPTIMIZE improves the efficiency of read queries, making the data lake more performant for BI tools and downstream processing tasks that require fast table scans.

Why this answer

The OPTIMIZE command compacts small files into larger files, which significantly improves read performance by reducing the metadata overhead of listing thousands of small files. It also allows for Z-Ordering, which collocated related information in the same files, enabling data skipping during query execution. These optimizations are crucial for maintaining high-performance data lakes as datasets grow over time in production environments.

Exam trap

Test-takers frequently select index-based choices or vacuum operations, forgetting that OPTIMIZE specifically focuses on file compaction and collaborative Z-Ordering data skipping.

58
MCQmedium

A data engineer needs to ensure that PII data in a Delta table is accessible only to users in the 'HR_Manager' group. Which approach provides the most granular and scalable security implementation?

A.Create separate views for each group and grant access to those views.
B.Implement column-level masking on the PII column.
C.Apply a row filter function to the table using Unity Catalog.
D.Use data partitioning to store HR data in separate folders.
AnswerC

Row filters in Unity Catalog allow for defining an expression that acts as a WHERE clause. By using the 'is_account_group_member' function, you can ensure that only members of the specified HR group see rows containing PII. This is the most efficient and manageable way to enforce granular row-level data access.

Why this answer

Using Unity Catalog's Row-Level Security (RLS) via SQL functions is the standard best practice. It dynamically filters rows at query time based on the execution context, such as the current user's group membership. This approach avoids duplicating data into siloed tables, minimizes maintenance overhead, and ensures consistent enforcement across different BI tools and compute resources connecting to the same catalog.

Exam trap

Candidates often pick view-based security or access control lists (ACLs) on storage paths, missing that Unity Catalog row filters offer granular, scalable security enforcement.

59
MCQmedium

When designing a Data Quality framework in Databricks, what is the recommended approach for handling 'quarantined' records?

A.Delete the bad records and notify the team via an automated Slack notification.
B.Move invalid records to a 'quarantine' table with an additional column indicating the error.
C.Update the records in place by setting the invalid fields to NULL.
D.Stop the entire pipeline execution to ensure no bad data reaches the final target.
AnswerB

This approach is the gold standard for robust ETL. By tagging records with the reason for failure, engineers can easily analyze the patterns of error and fix the source issues. It maintains a clean primary table while simultaneously building a valuable dataset of quality issues for analysis.

Why this answer

Storing invalid records in a separate, dedicated table allows for auditing and correction without blocking the main pipeline. This ensures high throughput for valid data while providing a clear path for reprocessing bad data once the underlying issue is fixed. It is a fundamental pattern for resilient data engineering, ensuring that data is never silently dropped and that stakeholders maintain confidence in the data's reliability.

Exam trap

Candidates frequently suggest deleting invalid records outright. They often overlook the requirement for auditing and reprocessing, which necessitates moving data to a quarantine table rather than simply discarding it.

60
MCQmedium

A Data Engineer needs to verify that the column 'user_id' is unique in a critical Gold table. What is the most efficient, non-blocking way to perform this check in a production environment?

A.Run a daily query: SELECT COUNT(user_id) - COUNT(DISTINCT user_id).
B.Define a primary key constraint in the Delta table definition.
C.Use a custom UDF to check for duplicates inside a Spark streaming loop.
D.Perform a left-anti join with the previous day's data every time the pipeline runs.
AnswerB

Delta Lake supports primary key constraints, which are natively enforced during the transaction. This is the most efficient and robust way to guarantee uniqueness, as the engine rejects any attempt to insert a duplicate value, maintaining the 'single source of truth' integrity required for production-grade analytical and operational data.

Why this answer

Using a Delta constraint or a DLT expectation is the most efficient way to enforce uniqueness at the storage layer. Unlike a full table scan query, which is reactive and performance-intensive, native constraints are checked during the commit process, providing proactive quality assurance. This ensures that the table never enters an invalid state, which is vital for the integrity of downstream machine learning models and reporting applications.

Exam trap

Candidates often suggest running a 'SELECT COUNT(DISTINCT id)' query as a post-process check. This is inefficient and reactive, whereas Delta constraints are proactive and enforced at the write level.

61
MCQmedium

When migrating an existing Hive metastore to Unity Catalog, what is the most important security consideration regarding object naming?

A.Table names must be all uppercase.
B.The object names must fit the catalog.schema.table structure.
C.Legacy object owners must be deleted.
D.All tables must be converted to Parquet.
AnswerB

Unity Catalog requires a strict three-level namespace. During migration, existing objects must be mapped to this structure. Failure to do so will prevent the object from being accessible within the new governed environment, potentially leading to downtime or security gaps during the transition from the legacy Hive metastore.

Why this answer

In Unity Catalog, the three-level namespace (catalog.schema.table) is mandatory. Existing Hive metastore objects often lack this structure and may contain characters or naming patterns that are incompatible with Unity Catalog's standards. Ensuring a clean naming convention during migration is not just a structural requirement; it is a security necessity to ensure that existing access policies can be correctly migrated and enforced in the new, more rigorous governance environment.

Exam trap

Candidates often focus solely on permission remapping while ignoring that Unity Catalog enforces a strict three-level namespace structure.

62
MCQmedium

A data engineer is developing a PySpark job that reads from a Delta table and performs a series of transformations. The engineer notices that the job is slow and suspects that the query plan is not optimized because statistics are outdated. Which command should the engineer run to update the statistics for the Delta table to improve query performance?

A.VACUUM table_name
B.REFRESH TABLE table_name
C.OPTIMIZE table_name
D.ANALYZE TABLE table_name COMPUTE STATISTICS
AnswerD

This command computes statistics for the table, which the Spark optimizer uses to make better decisions about join strategies, filter pushdown, and other optimizations. In Databricks, running ANALYZE TABLE on a Delta table updates the statistics stored in the metastore. This is essential when data has changed significantly, as outdated statistics can lead to suboptimal query plans. It directly addresses the scenario of improving query performance by refreshing metadata.

Why this answer

The correct command is ANALYZE TABLE table_name COMPUTE STATISTICS. This command gathers statistics such as row count, column cardinality, and min/max values, which the Spark optimizer uses to generate efficient query plans. Outdated statistics can cause poor join orders or unnecessary shuffles.

OPTIMIZE, VACUUM, and REFRESH TABLE serve different purposes and do not update statistics. Therefore, ANALYZE TABLE is the appropriate action to improve performance when statistics are stale.

Exam trap

The trap here is assuming that OPTIMIZE, which improves file layout, also updates statistics; however, statistics are separate metadata that require the ANALYZE TABLE command.

63
MCQeasy

A data engineer wants to share a Delta table with an external partner who does not have a Databricks account. The partner needs to access the data using Python. Which method should the engineer recommend to the partner for accessing the shared data?

A.Mount the shared table as an external table in their local Spark cluster using the Delta Sharing connector.
B.Use the Databricks SQL Connector for Python with the partner's Databricks personal access token.
C.Install the delta-sharing Python library and use the provided credential file to read the shared table.
D.Download the shared table as a Parquet file from the Databricks workspace and load it into their Python environment.
AnswerC

The delta-sharing Python library is specifically designed for recipients to access Delta Shares without needing a Databricks account. The partner can install the library via pip, use the credential file provided by the data engineer, and read the shared table as a pandas DataFrame or Apache Spark DataFrame. This method is secure, supports the Delta Sharing protocol, and is the recommended approach for non-Databricks recipients.

Why this answer

For recipients without a Databricks account, the delta-sharing Python library is the standard way to access shared data. It uses the credential file to authenticate and allows reading the shared table into Python. This method is secure, supports live data, and does not require Databricks infrastructure on the recipient side.

Other methods either require Databricks access or are not part of the Delta Sharing protocol.

Exam trap

The trap here is assuming that the partner needs Databricks-specific tools like the SQL Connector, when the open Delta Sharing protocol provides a dedicated Python library for non-Databricks users.

64
MCQmedium

Which Databricks feature provides the most granular view of data quality metrics over time for a Delta Live Tables pipeline?

A.Pipeline Run logs
B.DLT Event Log system table
C.Cluster log files
D.SQL warehouse query history
AnswerB

The DLT event log system table contains detailed records for each pipeline update, including every expectation violation. It is the best source for performing historical analysis and creating trends of data quality health across the entire lifecycle of the data.

Why this answer

The DLT 'event log' (stored as a system table) is the most powerful tool for analyzing data quality. It records every expectation check, allowing for historical trend analysis of data quality violations. This is critical for data governance, as it provides auditability and helps engineers identify when and where data quality has degraded over time, enabling proactive fixes to source upstream data.

Exam trap

Candidates often select 'Delta Log' or 'Table History' instead of the 'DLT Event Log', failing to realize that DLT pipelines have a specific, dedicated log for quality expectations.

65
MCQmedium

A Data Engineer is using Databricks Asset Bundles (DABs) to manage a project. Where should the engineer define the job settings, such as clusters, schedules, and task dependencies?

A.In a hardcoded JSON file located in the /tmp/ directory.
B.In a databricks.yml file within the project root.
C.Inside the Python code using the dbutils.job() library.
D.By manually clicking through the Databricks UI after deployment.
AnswerB

The databricks.yml file is the central configuration file for Databricks Asset Bundles. It contains the schema definitions for resources, including jobs, pipelines, and delta tables. This file serves as the single source of truth for the deployment, ensuring that all job definitions are versioned, reproducible, and easily deployable via the CLI.

Why this answer

Databricks Asset Bundles use YAML files, specifically those located in the bundles configuration folder, to manage infrastructure as code. Defining job settings in the `databricks.yml` file allows for version control and consistent deployments across different environments (dev, staging, prod). This approach ensures that the entire project state is replicable and managed through a standardized CI/CD pipeline, reducing manual configuration errors and increasing the speed of environment deployments.

Exam trap

Candidates often confuse DABs configuration with traditional Spark submit scripts or workspace notebooks, incorrectly choosing standalone python or notebook files instead of the root-level YAML configuration required for bundle deployments.

66
MCQeasy

A data engineer needs to inspect the logs of a long-running Databricks job that has already completed. Where should they navigate in the Databricks UI to find the driver logs?

A.The 'Clusters' tab under the 'Event Log' section.
B.The 'Runs' tab within the specific Job's detail page.
C.The 'Workspace' folder where the notebook is stored.
D.The 'SQL Warehouses' monitoring dashboard.
AnswerB

The 'Runs' tab contains the history of all past job executions. By clicking into a specific run, users can access the task logs, driver logs, and Spark UI links. This is the intended UI location for inspecting logs for completed or failed jobs to determine the root cause.

Why this answer

The Job Runs view provides a comprehensive audit trail of all executions, including specific task logs and driver output. Accessing the 'Runs' tab for a specific job allows the engineer to select a historical run and view the standard output and standard error streams. This is the primary interface for post-mortem debugging and understanding the execution context of failed tasks that are no longer actively running on a cluster.

Exam trap

Candidates often look in the 'Cluster' logs tab or the 'Workspace' file browser, assuming job logs are stored in the same place as cluster-level event logs or source code.

67
Multi-Selecthard

Which THREE actions can help reduce the 'shuffle' operations in a Spark job?

Select 3 answers
A.Use broadcast joins for small tables to keep the join operation local.
B.Increase the number of shuffle partitions significantly for small datasets.
C.Bucket tables to ensure co-location of data for joins and aggregations.
D.Always use 'repartition()' before any operation to ensure even data distribution.
E.Filter data before performing expensive transformations or joins.
AnswersA, C, E

Broadcasting small tables sends the data to all nodes, allowing the join to happen locally. This prevents the large table from being shuffled across the network, which is the primary driver of performance degradation in joins. It is a highly effective way to eliminate unnecessary network traffic.

Why this answer

Shuffling is the most expensive operation in Spark because it involves network I/O and data serialization across worker nodes. Reducing shuffles is achieved by minimizing the volume of data shuffled (e.g., using broadcast joins), pre-partitioning data (e.g., using bucketing), or performing operations that keep data local to the worker. These strategies ensure that data is processed in place, dramatically reducing execution time and cluster resource usage for complex data transformations.

Exam trap

Candidates often suggest increasing cluster resources (like memory or CPU) as a fix for shuffle issues, rather than focusing on architectural changes like broadcasting or bucketing to avoid the shuffle entirely.

68
MCQeasy

A data engineer is using PySpark to cleanse a DataFrame containing customer addresses. The 'zip_code' column has some values with leading zeros that were stripped during CSV ingestion. The engineer needs to restore all zip codes to a fixed 5-character length by padding with leading zeros. Which function should be used?

A.regexp_replace(zip_code, '^', '0')
B.format_string('%05d', zip_code)
C.rpad(zip_code, 5, '0')
D.lpad(zip_code, 5, '0')
AnswerD

The lpad function pads the left side of a string with a specified character until it reaches the desired length. Using lpad(zip_code, 5, '0') ensures every zip code becomes exactly 5 characters, restoring leading zeros that were lost. This is the correct and idiomatic way to fix the issue in PySpark without complex logic.

Why this answer

The lpad function is designed to pad strings on the left to a specified length. It correctly restores leading zeros for zip codes that lost them during ingestion, ensuring all values are exactly 5 characters. Other functions either pad on the wrong side, assume numeric types, or do not achieve the required fixed length.

Exam trap

The trap here is confusing lpad with rpad, or assuming that zip codes are numeric and can be formatted as integers.

69
MCQhard

Refer to the exhibit. A user encounters this error when running a query. What is the correct action to resolve this issue while maintaining the security model?

A.Grant 'SELECT' on the 'q1_data' table to the user.
B.Grant 'USE CATALOG' on the 'finance' catalog to the user.
C.Change the user's role to 'Account Admin' to bypass restrictions.
D.Move the 'q1_data' table to a catalog where the user has access.
AnswerB

The 'USE CATALOG' privilege is required to access any object within a catalog. By granting this to the user, you enable them to traverse the hierarchy to reach the schema and the table. This is the minimum required privilege to fix the broken path and resolve the access error.

Why this answer

In Unity Catalog, the security model is hierarchical. To access a table, the user needs 'USE CATALOG' on the catalog, 'USE SCHEMA' on the schema, and 'SELECT' on the table. The error indicates the hierarchy is broken at the top level.

Granting the necessary privileges allows the user to traverse the object tree, ensuring that security is enforced consistently from the catalog down to the individual data object.

Exam trap

A common mistake is granting SELECT directly on the table without providing the necessary hierarchical traversal permissions like USE CATALOG and USE SCHEMA.

70
MCQeasy

What is the primary benefit of the Medallion architecture in a Databricks Lakehouse?

A.It eliminates the need for data partitioning and Z-Ordering.
B.It provides a clear progression of data quality and structure.
C.It forces all data to be stored in a star schema at all layers.
D.It automatically converts all incoming data to a structured format.
AnswerB

The medallion architecture organizes data into Bronze, Silver, and Gold to represent increasing levels of refinement. This structured approach allows teams to manage data quality incrementally, ensures that business logic is applied consistently, and provides an immutable raw history that can be reprocessed whenever requirements change.

Why this answer

The Medallion architecture provides a clear, structured progression of data quality. By segregating data into Bronze (raw), Silver (cleaned), and Gold (refined) layers, organizations can maintain an immutable audit trail while enabling both technical teams and business analysts to consume the data at the appropriate level of abstraction. This structure simplifies data governance, incremental processing, and data quality management, which are fundamental to building a reliable Lakehouse.

Exam trap

Candidates often mistake Medallion architecture for a data storage optimization technique, focusing on performance gains rather than the primary goal of improving data quality and organizational structure.

71
MCQeasy

A data engineer is deploying a Databricks job using Databricks Asset Bundles. They want to ensure that the job uses a specific cluster configuration that is defined once and reused across multiple tasks. Which bundle feature should they use?

A.Use a `new_cluster` definition for each task, ensuring they all have identical configurations.
B.Define a `job_cluster` in the job's `job_clusters` section and reference it by key in each task.
C.Define a cluster in the `resources/clusters` directory and reference it in the job.
D.Use an `existing_cluster_id` for all tasks, pointing to a pre-created cluster.
AnswerB

The `job_clusters` section allows defining reusable cluster configurations at the job level. Each task can then reference a cluster by its key using the `job_cluster_key` field. This promotes consistency and reduces duplication. It is the intended way to share cluster settings across tasks within a single job.

Why this answer

The `job_clusters` section in a Databricks job definition allows specifying cluster configurations that can be referenced by multiple tasks via `job_cluster_key`. This is the correct way to define a cluster once and reuse it across tasks within the same job, ensuring consistency and simplifying maintenance. Other options either duplicate configuration or rely on external resources.

Exam trap

The trap here is confusing job-level cluster definitions with task-level `new_cluster` or external cluster references, which do not provide the same reusability.

72
Multi-Selectmedium

Which TWO of the following are primary benefits of using Unity Catalog for data governance in Databricks?

Select 2 answers
A.It provides a centralized interface for managing permissions across multiple workspaces.
B.It automatically encrypts all data files at rest using AES-256.
C.It captures fine-grained data lineage for data assets.
D.It allows users to bypass Spark SQL for direct file-system operations.
E.It replaces the need for IAM roles when accessing external data.
AnswersA, C

Centralized access control is a core feature of Unity Catalog. It allows administrators to define permissions once in a single catalog and apply them consistently across all workspaces attached to that metastore. This drastically reduces the administrative burden and minimizes the risk of inconsistent security policies across environments.

Why this answer

Unity Catalog provides a unified governance layer that simplifies security across different workspaces. Its primary value lies in centralized access control and a unified auditing capability. By providing a single source of truth for permissions and data lineage, it significantly reduces the complexity of managing large-scale data environments while ensuring compliance with internal security policies and regulatory frameworks.

Exam trap

Candidates often select compute-performance or cluster-management advantages, incorrectly associating them with Unity Catalog instead of data governance.

73
MCQmedium

A data engineer is configuring monitoring for a production Databricks cluster. Which TWO metrics are best suited to identify potential performance bottlenecks related to worker nodes?

A.Cluster CPU utilization percentage.
B.Number of active jobs currently running in the entire workspace.
C.Cluster memory usage percentage.
D.Total number of users logged into the Databricks workspace.
E.The version of the Databricks Runtime used by the cluster.
AnswerA, C

High CPU utilization across worker nodes is a primary indicator of compute-bound tasks or inefficient code. Monitoring this helps identify when a cluster is saturated, potentially leading to slow query execution or timeouts. Regularly tracking this metric allows for proactive auto-scaling configurations to handle varying workload demands effectively.

Why this answer

Monitoring worker nodes is vital for identifying bottlenecks before they cause job failures. Metrics like CPU utilization and memory usage are key indicators of node pressure. By identifying these patterns, engineers can optimize cluster configurations, adjust instance types, or tune spark code, ensuring that production workloads remain stable, performant, and cost-effective throughout their execution lifecycle.

Exam trap

Candidates often pick storage or network metrics like disk IOPS or network throughput, forgetting that CPU and memory are the primary indicators of worker node compute bottlenecks.

74
MCQmedium

A data engineer is using Databricks Repos to manage a project. They need to ensure that the production job always uses the code from the 'main' branch, even if developers push changes to other branches. Which Git reference should be used in the job configuration to achieve this?

A.The branch name 'main'
B.A specific commit hash
C.The remote URL of the repository
D.A tag named 'production'
AnswerA

Specifying the branch name 'main' in the job configuration ensures that the job checks out the latest commit on that branch at runtime. This means any new commits pushed to 'main' will be used in subsequent job runs, satisfying the requirement to always use production code from 'main'.

Why this answer

In Databricks Repos, job configurations can reference a Git branch, tag, or commit. To always use the latest code from the 'main' branch, the job should be configured with the branch name 'main'. At runtime, Databricks checks out the latest commit on that branch.

Using a commit hash or tag would pin to a specific version and not automatically update, which is unsuitable for continuous deployment.

Exam trap

The trap here is assuming that a tag or commit hash provides the same automatic updates as a branch, when in fact they are static references.

75
MCQhard

A data engineer is ingesting data from an Apache Kafka topic into a Delta Lake table using Structured Streaming. The Kafka topic receives messages with a timestamp field in the value payload, but the messages can arrive out of order by up to 10 minutes. The engineer wants to perform time-windowed aggregations on the ingested data while minimizing state store overhead. Which approach should be used to handle the out-of-order data correctly?

A.Use withWatermark on the event-time column extracted from the Kafka value and set the watermark to 10 minutes.
B.Configure the Kafka source with 'startingOffsets' set to 'latest' and enable auto-commit of offsets.
C.Repartition the stream by the Kafka partition ID and sort within each partition using a custom foreachBatch function.
D.Set the Kafka consumer property 'isolation.level' to 'read_committed' to ensure only committed messages are processed.
AnswerA

Watermarking allows the stream to handle late data by defining a threshold beyond which late events are dropped. By extracting the event-time column from the Kafka value and applying a 10-minute watermark, the aggregation can correctly include events that arrive within that window. This minimizes state store overhead because the watermark instructs the engine to clean up old state. It is the standard approach for out-of-order data in Structured Streaming.

Why this answer

To handle out-of-order data in Structured Streaming, you must use event-time processing with watermarks. Extracting the event-time column from the Kafka value and applying a watermark of 10 minutes allows the engine to wait for late data up to that threshold and then clean up state. This minimizes state store overhead and ensures correct time-windowed aggregations.

Other options do not address event-time semantics or state management.

Exam trap

The trap here is confusing Kafka consumer properties or offset management with event-time processing, leading to solutions that do not actually handle late-arriving data or manage state.

Page 1 of 4

Page 2

All pages