Courseiva

Databricks Certified Data Engineer Professional (Databricks-DE-Pro) — Questions 151–225

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

Page 2

Page 3 of 4

Page 4
151
MCQeasy

A data engineer wants to monitor the performance of a Databricks cluster by tracking the average CPU utilization over time. Which Databricks feature should they use to visualize this metric?

A.Cluster metrics dashboard in the Databricks UI
B.Spark UI
C.Databricks SQL dashboards
D.Ganglia
AnswerA

The cluster metrics dashboard in the Databricks UI provides real-time and historical charts of CPU utilization, memory usage, and other metrics for a cluster. It is the built-in tool for visualizing cluster performance over time, making it the correct choice for this scenario.

Why this answer

The cluster metrics dashboard in the Databricks UI is designed to display cluster performance metrics such as CPU utilization, memory usage, and network activity. It provides both real-time and historical views, allowing engineers to monitor trends and identify performance issues. Other tools like Spark UI focus on job execution, while Databricks SQL dashboards are for data visualization, not infrastructure monitoring.

Therefore, the cluster metrics dashboard is the correct choice.

Exam trap

The trap here is confusing the Spark UI, which shows job-level details, with the cluster metrics dashboard, which shows infrastructure-level metrics.

152
MCQmedium

A data engineering team experiences massive compute waste because interactive development notebooks are frequently left running overnight by engineers. As a Databricks administrator, which configuration should you implement at the cluster policy level to automatically mitigate this financial exposure without disrupting ongoing development work?

A.Configure a maximum worker node limit constraint within the compute policy that prevents scaling beyond two nodes.
B.Enforce a strict maximum instance lifetime limit that terminates the cluster regardless of whether interactive queries or jobs are running.
C.Set a mandatory auto_termination_minutes rule in the cluster policy enforcing a maximum idle timeout threshold for all user-created clusters.
D.Disable the ability for standard users to attach notebooks to interactive clusters, forcing all execution through scheduled jobs.
AnswerC

Mandating an idle termination timeout via cluster policies automatically reclaims compute resources whenever user activity ceases for a designated duration. It strikes the ideal balance by allowing full scaling flexibility during work hours while shutting down idle infrastructure automatically.

Why this answer

Enabling automatic cluster termination based on an idle timeout is the most direct policy enforcement mechanism to eliminate compute waste from forgotten interactive sessions. This setting continuously monitors the execution state of the driver and worker nodes, shutting down the cluster safely once the specified threshold is crossed, which drastically reduces cloud infrastructure spending while preserving user autonomy during active hours.

Exam trap

Candidates frequently choose 'cluster termination settings' at the workspace level or assume manual user training is sufficient, failing to realize that cluster policies are the mandatory enforcement mechanism.

153
MCQmedium

A data engineer has set up a Databricks SQL alert on a query that returns the count of failed jobs in the last hour. The alert is configured to trigger when the count exceeds 5. The engineer wants to receive notifications via email and also wants to view the alert history to understand past triggers. Which statement accurately describes the alert notification and history capabilities?

A.Alerts can only send notifications to email addresses and do not retain any history of triggers.
B.Alerts can only be configured to trigger once and then must be manually reset, and history is only available via the API.
C.Alerts can send notifications only to the alert owner's email, and history is stored for 7 days.
D.Alerts can send notifications to email, Slack, and other destinations, and the alert history is available in the Databricks SQL UI.
AnswerD

Databricks SQL alerts support email, Slack, PagerDuty, and webhook notifications. The alert history, including trigger times and query results, is accessible in the Databricks SQL UI under the alert's details. This statement correctly describes both the notification flexibility and the history feature, making it the accurate choice.

Why this answer

Databricks SQL alerts are versatile: they can notify via email, Slack, PagerDuty, or webhooks, and they maintain a history of triggers that can be reviewed in the UI. This allows teams to audit past alert conditions and responses. The other options either limit notification channels or incorrectly describe history retention, making them inaccurate.

Exam trap

The trap here is assuming that alerts only support email and that history is not readily available, when in fact Databricks provides multiple notification integrations and UI-based history.

154
MCQhard

A data engineer is using Databricks Asset Bundles to deploy a job that runs a Python wheel task. The bundle is deployed to a production workspace using a service principal. The job fails with the error: `Library installation failed for library due to user error: Could not find wheel file`. The engineer confirms the wheel file exists in the bundle's `dist` folder. What is the most likely cause of this failure?

A.The wheel file path in the task definition is relative to the workspace root instead of the bundle root.
B.The wheel file is not compatible with the Databricks Runtime version used by the cluster.
C.The service principal lacks permission to read from the `dist` folder in the workspace.
D.The wheel file is not included in the bundle's artifact definition, so it is not uploaded to the workspace.
AnswerD

In Databricks Asset Bundles, artifacts such as Python wheels must be explicitly defined in the `artifacts` section of `databricks.yml`. If the wheel is not listed, it will not be uploaded during deployment, and the job cannot find it. The `dist` folder alone does not guarantee inclusion; the artifact must be declared and built.

Why this answer

For a Python wheel task in a Databricks Asset Bundle, the wheel must be declared as an artifact in the bundle configuration. This ensures it is built and uploaded to the workspace during deployment. Without this, the job cannot locate the wheel, leading to the error.

The other options incorrectly attribute the failure to permissions, path resolution, or compatibility.

Exam trap

The trap here is assuming that placing the wheel in the local `dist` folder is sufficient, when the bundle must explicitly declare and upload artifacts.

155
MCQmedium

You are tasked with handling PII (Personally Identifiable Information) in your data pipeline. Which approach is best for protecting this data while maintaining the ability to perform analytics?

A.Simply drop the PII columns during the Bronze-to-Silver transformation.
B.Encrypt the PII data using a shared key stored in the pipeline code.
C.Hash the PII columns using a salted, non-reversible cryptographic hash function.
D.Use a public, non-salted MD5 hash function to ensure consistency across teams.
AnswerC

Hashing with a salt provides a secure, non-reversible way to mask PII while maintaining referential integrity. This allows analysts to group data by the hash key without seeing the actual sensitive values. It is a highly recommended practice for balancing data utility with strict regulatory and privacy requirements.

Why this answer

Hashing or tokenizing PII allows for unique identification without exposing sensitive information. This is a standard practice for compliance (e.g., GDPR, CCPA). By using consistent hashing, you maintain the ability to join tables or perform group-bys on the hashed key while ensuring that unauthorized users cannot reverse-engineer the sensitive original values, balancing security with functional analytical utility.

Exam trap

Candidates frequently assume that dropping PII columns is the only compliance method, forgetting that cryptographic hashing allows analytics while protecting sensitive data.

156
MCQhard

You are debugging a PySpark job that is experiencing severe memory pressure during a join on a massive column. You suspect data skew. Which approach is best to mitigate this issue?

A.Increase the number of partitions using 'spark.sql.shuffle.partitions'.
B.Implement a salted join by adding a random integer to the join key.
C.Use the 'cache()' method on the skewed dataframe.
D.Enable AQE and increase the 'spark.sql.adaptive.skewJoin.enabled' setting.
AnswerB

Salting splits a single skewed key into multiple keys by appending a random integer. This spreads the data across multiple partitions, ensuring that no single task is overwhelmed. By expanding the join key on both sides, the join can be completed in parallel, effectively resolving the performance bottleneck.

Why this answer

Data skew is a common performance bottleneck in distributed systems where one task takes significantly longer than others because it processes a disproportionate amount of data. By salting the skewed key—adding a random prefix or suffix—the data is distributed more evenly across the cluster partitions. This technique prevents executor memory overflow and allows for parallel processing of the skewed key, significantly improving overall job performance and reliability.

Exam trap

Test-takers frequently suggest broadcasting the large skewed table or increasing executor memory, ignoring the root cause of uneven partition distribution.

157
MCQhard

A data engineer is automating the deployment of Databricks assets using CI/CD. The pipeline fails because the 'databricks-cli' command cannot find the workspace. What is the most likely cause?

A.The Databricks CLI version on the build agent is incompatible with the server.
B.The runner does not have the DATABRICKS_HOST and DATABRICKS_TOKEN environment variables set.
C.The workspace API is currently disabled for security reasons.
D.The CI/CD runner is missing the required library dependencies like PySpark.
AnswerB

The Databricks CLI looks for these specific environment variables to authenticate with the workspace. If they are absent, the CLI cannot establish a connection, leading to an error indicating that it cannot reach or find the workspace. This is the most common cause of failures in automated pipelines.

Why this answer

Deployment failures in CI/CD often stem from authentication or environment variable misconfiguration. The Databricks CLI requires a properly configured profile or environment variables containing the host URL and token. When these are missing, the CLI fails to authenticate or locate the workspace, preventing the deployment of code.

Ensuring that the runner has access to these secure variables is foundational for a reliable DevOps lifecycle for Databricks infrastructure.

Exam trap

Candidates frequently assume CI/CD deployment failures are caused by syntax errors in configuration files rather than missing runtime environment variables.

158
Multi-Selectmedium

Which THREE features are provided by Delta Lake when compared to standard Parquet files? (Select THREE)

Select 3 answers
A.ACID transactions
B.Automatic indexing for all columns
C.Time travel
D.Schema enforcement
E.Built-in support for real-time web socket streaming
AnswersA, C, D

ACID compliance ensures that data reads and writes are atomic, consistent, isolated, and durable. This prevents partially written files from appearing in queries if a job fails mid-run. This capability is the foundation of reliable data pipelines, allowing for concurrent reads and writes without risking data corruption or inconsistency across the platform.

Why this answer

Delta Lake adds a transaction log (the _delta_log) to standard Parquet files, enabling ACID transactions, time travel, and schema enforcement. These features solve common data engineering pain points such as partial writes, data corruption, and the inability to revert to previous versions of data. Mastering these capabilities is essential for building reliable data lakes that provide the same consistency and reliability as traditional data warehouses.

Exam trap

Candidates often include features like 'data compression' or 'partitioning', which are inherent to Parquet itself, rather than features added specifically by the Delta Lake layer.

159
MCQhard

A data engineer is using PySpark to process a large DataFrame and needs to reduce the number of partitions before writing to a Delta table to avoid creating too many small files. The DataFrame currently has 2000 partitions, each about 10 MB. The engineer wants to reduce the number of partitions to approximately 200 while minimizing data shuffling. Which approach is most appropriate?

A.Use repartition(200) to evenly redistribute the data across 200 partitions.
B.Use coalesce(200) to reduce the number of partitions without a full shuffle.
C.Use repartitionByRange(200) on a key column to control data distribution.
D.Use bucketBy(200, 'id') and saveAsTable to create 200 buckets.
AnswerB

coalesce is designed to reduce the number of partitions by combining existing partitions without a full shuffle. It moves data from some partitions to others on the same executor, which is efficient for reducing partition count. In this scenario, coalesce(200) will merge the 2000 partitions into 200, each approximately 100 MB, without incurring a wide shuffle. This minimizes network overhead and is suitable when the goal is to reduce the number of output files.

Why this answer

The correct answer is to use coalesce(200). coalesce reduces the number of partitions by merging existing partitions without a full shuffle, which is efficient for decreasing partition count. It is particularly useful when the partitions are already reasonably sized and you just want to reduce the number of output files. repartition would work but causes a full shuffle, which is unnecessary here. The other options involve shuffles or are not designed for simple partition reduction.

Exam trap

The trap here is confusing coalesce with repartition; coalesce avoids a full shuffle but may result in uneven partition sizes, while repartition ensures even distribution at the cost of a shuffle.

160
MCQhard

A data engineer is using Delta Live Tables (DLT) to create a pipeline that processes streaming data. They need to ensure that the pipeline only processes new data since the last run and that the pipeline can recover from failures without reprocessing all data. Which combination of features should they use to achieve this?

A.Use a streaming live table and rely on DLT's automatic checkpointing and state management.
B.Use a streaming live table with a checkpoint location specified in the pipeline configuration.
C.Use a materialized view with a trigger to process only new data based on a timestamp column.
D.Use a batch live table with a filter on the ingestion timestamp to process only new records.
AnswerA

DLT automatically manages checkpoints and state for streaming live tables. It tracks the progress of the stream and ensures that only new data is processed. On failure, DLT can recover from the last checkpoint without reprocessing all data. This is the correct approach because DLT handles the complexity of checkpointing and state management internally.

Why this answer

DLT streaming live tables automatically manage checkpoints and state, ensuring that only new data is processed and that the pipeline can recover from failures without reprocessing all data. This is a core feature of DLT. The other options either incorrectly rely on manual checkpointing, use batch constructs that don't support incremental processing, or misunderstand the capabilities of materialized views.

Exam trap

The trap here is thinking that you need to manually specify a checkpoint location for DLT streaming tables, when DLT handles checkpointing automatically.

161
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 and update already processed aggregates. Which watermark strategy should be used to allow updates to aggregates while bounding state store growth?

A.Use a watermark based on processing time rather than event time, with a 10-minute delay.
B.Use a watermark on the event-time column with a delay of 0 seconds to ensure all data is processed immediately.
C.Use a watermark on the event-time column with a delay that accommodates the maximum expected lateness, and set the output mode to 'update'.
D.Use a static watermark of 1 hour by setting the watermark delay to '1 hour' on the event-time column.
AnswerC

This approach correctly uses event-time watermarks to bound state by allowing late data up to a specified delay. The 'update' output mode emits only updated aggregates, which is efficient for updating results. By setting the delay to the maximum expected lateness, the engineer ensures that late data within that window is processed, and state older than the watermark is dropped. This balances correctness and resource usage in a streaming aggregation.

Why this answer

The correct answer is to use an event-time watermark with a delay that matches the maximum expected lateness and to use the 'update' output mode. This allows late data to be incorporated into aggregates while bounding state store growth. The watermark tells the engine how long to wait for late data before finalizing a window, and 'update' mode emits incremental updates, which is ideal for updating aggregates.

Other options either use inappropriate time semantics or set delays that are too short.

Exam trap

The trap here is assuming that any watermark will automatically handle late data, but the delay must be set based on the actual lateness characteristics; too short a delay drops data, too long a delay grows state unnecessarily.

162
Multi-Selecthard

Which TWO statements regarding the use of 'APPLY CHANGES INTO' in Delta Live Tables (DLT) are correct?

Select 2 answers
A.It supports schema evolution automatically when adding new columns to the source stream.
B.It can be used to perform deletes on the target table by issuing manual DELETE commands.
C.It requires the source to be a streaming table or a view registered in the pipeline.
D.It allows for multiple primary keys, but only one can be used for sequencing the updates.
E.It automatically creates a history table for SCD Type 1 processing by default.
AnswersA, C

APPLY CHANGES INTO inherently supports schema evolution, allowing the target table to adapt to new columns present in the source stream. This is essential for long-running pipelines where source data structures might change over time, ensuring that the target reflects the latest source state without requiring manual intervention.

Why this answer

APPLY CHANGES INTO is the declarative mechanism for SCD Type 1 or Type 2 processing in DLT. It manages the complexity of merging streaming data into a target table, handling late-arriving data and updates efficiently. Understanding its constraints, such as the requirement for a defined primary key and the inability to perform manual data deletions, is critical for maintaining consistent state in bronze-to-silver transformations.

Exam trap

Candidates often assume 'APPLY CHANGES INTO' works on static tables or supports manual deletes. They frequently overlook that it is designed specifically for streaming, SCD-based incremental updates.

163
MCQmedium

Refer to the exhibit. An engineer observes that queries filtering on 'customer_id' are running slowly despite Z-Ordering. What is the most likely cause?

A.The partition columns should include 'customer_id' to improve the pruning speed.
B.Z-Ordering must be performed on the partition columns instead of the join columns.
C.The queries lack filters on 'region' or 'date', preventing effective partition pruning.
D.The file format should be changed to Parquet to improve individual file read performance.
AnswerC

Because the table is partitioned by region and date, failing to include these in the WHERE clause forces the engine to scan every partition. Z-Ordering only clusters data within individual partitions. If the engine doesn't prune the partitions first, the Z-Ordering benefits are largely ignored during the scan.

Why this answer

The exhibit shows that the table is partitioned by 'region' and 'date', while Z-Ordering is applied to 'customer_id'. If queries filter on 'customer_id' but do not provide 'region' or 'date', the engine must scan all partitions. Z-Ordering is only effective within each partition.

If the data is not well-clustered or the partitions are too large, the engine cannot skip files effectively, leading to high latency during execution.

Exam trap

Candidates often blame the Z-Ordering configuration itself, assuming it is broken, rather than realizing that Z-Ordering cannot overcome the lack of partition pruning in the query filter.

164
MCQhard

A data engineer is debugging a Databricks job that reads from a Delta table and writes to another Delta table. The job occasionally fails with 'ConcurrentAppendException'. The engineer wants to minimize failures while maintaining data correctness. Which approach should the engineer take?

A.Disable Delta Lake transaction logging on the target table
B.Increase the job cluster's autoscaling maximum worker count
C.Use optimistic concurrency control with retry logic and partition the target table to reduce conflicts
D.Switch the target table to a Parquet table to avoid transaction conflicts
AnswerC

ConcurrentAppendException occurs when two writers attempt to add files to the same partition. Delta Lake uses optimistic concurrency; retrying the transaction and partitioning the target table to isolate writes reduces the chance of conflicting appends. This maintains correctness while improving success rates.

Why this answer

ConcurrentAppendException arises when multiple writers append to the same Delta table partition. Delta's optimistic concurrency control detects the conflict. Adding retry logic allows transient conflicts to resolve, and partitioning the target table by a key that separates writers reduces overlapping appends, preserving correctness while minimizing failures.

Exam trap

The trap here is thinking that scaling compute or changing file format solves a transactional concurrency conflict, when the fix lies in write isolation and retry behavior.

165
Multi-Selecthard

A data engineer is using Delta Live Tables (DLT) to build a pipeline that ingests data from a streaming source. The pipeline must ensure that the target table is updated incrementally and that data quality constraints are enforced. The engineer wants to use expectations to drop invalid records while maintaining pipeline performance. Which TWO of the following are true regarding DLT expectations and their behavior? (Choose two.)

Select 2 answers
A.When an expectation with 'drop' action is violated, the pipeline fails and must be restarted.
B.Expectations can only be applied to streaming tables, not to materialized views.
C.Expectations with the 'drop' action will remove records that violate the constraint from the target table.
D.Expectations are evaluated only during the initial data load, not on subsequent incremental updates.
E.Expectations with the 'fail' action will immediately stop the pipeline and require manual intervention to resume.
AnswersC, E

In DLT, expectations can be configured with different actions: warn, drop, or fail. The 'drop' action filters out records that violate the expectation, preventing them from being written to the target table. This is useful for maintaining data quality without failing the pipeline. The dropped records are logged in the event log for monitoring.

Why this answer

DLT expectations support actions like warn, drop, and fail. The 'drop' action removes invalid records and continues, while 'fail' stops the pipeline. These actions apply to both streaming tables and materialized views, and are evaluated on every update, not just the initial load.

Thus, the statements about 'drop' and 'fail' are correct.

Exam trap

The trap here is assuming that 'drop' causes a pipeline failure or that expectations are only checked once.

166
MCQhard

An engineer notices that a SQL warehouse is frequently hitting 'Max Concurrency' limits. Which log should they consult to identify which specific queries are consuming most of the warehouse resources?

A.Cluster event logs
B.Query history system table
C.Job run history logs
D.Delta table access logs
AnswerB

The query history system table provides comprehensive details about every query executed, including the duration, user, warehouse, and CPU/memory footprint. It is the most appropriate source for identifying heavy queries causing concurrency limits to be reached.

Why this answer

The 'query_history' system table is the primary resource for analyzing query performance and resource consumption. By querying this table, engineers can attribute resource usage to specific users, notebooks, or warehouses. This is essential for troubleshooting concurrency bottlenecks, enabling teams to optimize expensive queries or adjust warehouse sizing to meet demand without impacting overall system performance or user productivity.

Exam trap

Candidates often choose 'Cluster Logs' to investigate SQL concurrency, missing that 'Query History' is the purpose-built system table for tracking resource consumption by specific SQL queries.

167
MCQhard

You are migrating a legacy ETL process to Delta Live Tables (DLT). You have an existing table defined with a complex transformation that involves a custom Python function using a third-party library. How should you structure this in DLT to ensure the function is available and correctly applied?

A.Define the function inside the same notebook but outside the 'dlt.table' function.
B.Hardcode the library path using 'sys.path.append'.
C.You cannot use custom Python functions in DLT.
D.Use the 'spark.udf.register' method globally.
AnswerA

Defining the function in the same module ensures it is accessible during the execution of the DLT pipeline. The decorator will register the function as part of the materialization process, allowing DLT to call it while processing data, provided that any necessary external libraries are also installed.

Why this answer

DLT pipelines require explicit management of dependencies. Using the 'dlt.table' decorator alongside proper library installation via cluster configuration or pip requirements ensures that Python functions are serialized and distributed to worker nodes. Understanding how DLT handles dependencies and decorators is critical for building reliable, production-grade pipelines that maintain parity with legacy logic while leveraging the automatic orchestration and quality management features inherent in the DLT framework.

Exam trap

Candidates often place custom logic inside the dlt.table function definition. This causes issues with function serialization and prevents the DLT engine from correctly capturing the transformation logic during the pipeline initialization phase.

168
MCQhard

When using the Unity Catalog, how should an engineer properly reference a table named 'sales' located in the 'finance' schema within the 'prod_catalog' catalog using Spark SQL?

A.SELECT * FROM finance.sales
B.SELECT * FROM prod_catalog.finance.sales
C.SELECT * FROM sales
D.SELECT * FROM catalog_prod.finance.sales
AnswerB

The three-level namespace (catalog.schema.table) is the standard for Unity Catalog. This specific syntax ensures that the Spark engine correctly routes the request through the Unity Catalog's security and metadata layers, validating permissions before attempting to read the underlying data stored in the cloud object storage bucket.

Why this answer

Unity Catalog uses a three-level namespace hierarchy: catalog.schema.table. This structure provides consistent governance and discovery across the entire Databricks account. Proper referencing requires the fully qualified name to ensure Spark identifies the exact object within the catalog's permission model.

This implementation is crucial for security and multi-tenant environments where namespaces must be strictly isolated to prevent unauthorized access and data leakage across production and development environments.

Exam trap

Candidates often use two-part naming (schema.table) or forget the catalog name. In Unity Catalog, the fully qualified three-level namespace (catalog.schema.table) is required for proper object identification.

169
MCQmedium

What is the primary function of a 'Personal Access Token' (PAT) in Databricks, and why is it considered a security risk if not managed properly?

A.It allows users to bypass multi-factor authentication.
B.It is intended for end-user dashboard access.
C.It provides long-lived programmatic access to the API.
D.It encrypts data stored in the workspace.
AnswerC

PATs provide a mechanism for scripts to authenticate with Databricks without interactive logins. Because they are long-lived, if they are hardcoded in scripts or exposed in logs, they provide an attacker with persistent access to the user's workspace, creating a significant security vulnerability if not rotated regularly.

Why this answer

Personal Access Tokens (PATs) are used for programmatic access to Databricks REST APIs. They authenticate the user and inherit their permissions. The risk lies in their longevity; if an unexpired token is leaked, an attacker can impersonate the user without needing to re-authenticate via SSO.

Therefore, limiting token duration and using service principals for automated tasks are crucial security measures to protect the platform.

Exam trap

Students mistakenly believe PATs bypass user permissions or act as cluster-level configs, ignoring that they inherit the creating user's full privileges.

170
MCQhard

Refer to the exhibit. A Databricks administrator wants to restrict access to a specific SQL Alert. Based on the JSON policy, which statement accurately describes the current permission model for this alert?

A.The user is allowed to modify the alert's query criteria and notification frequency.
B.The user can see the alert, but cannot trigger a manual refresh or modify the alert settings.
C.The user has sufficient permissions to delete the alert from the Databricks SQL workspace.
D.This JSON policy provides the user with global access to all alerts within the SQL warehouse.
AnswerB

The 'CAN_VIEW' permission level strictly limits the user to viewing the alert's current status and metadata. It prevents the user from performing administrative actions like refreshing the alert, editing the logic, or altering notification parameters. This ensures that unauthorized users cannot inadvertently impact the alerting infrastructure or its outputs.

Why this answer

The exhibit displays an Access Control List (ACL) entry granting 'CAN_VIEW' permission to a specific user for a single alert resource. In Databricks, SQL Alerts are secured via the workspace-level permission model. Understanding these JSON-based policy definitions is essential for data engineers tasked with auditing governance and ensuring that sensitive monitoring data is only accessible to authorized personnel during security reviews.

Exam trap

Candidates often confuse view permissions with admin privileges, mistakenly assuming that someone with CAN_VIEW access can also modify alert configurations or manually trigger a refresh.

171
MCQmedium

Your organization is ingesting sensitive PII data. You need to ensure that personal identifiers are masked during the ingestion process before they are stored in the Bronze layer of your Medallion architecture. What is the best practice for this?

A.Mask the data using Delta Lake column masking after the data reaches the Silver layer.
B.Apply masking logic within the initial streaming ingestion transformation.
C.Configure Unity Catalog to mask columns only for specific users.
D.Use a post-ingestion job to delete PII columns.
AnswerB

Applying masking logic during the initial ingestion transformation (e.g., using withColumn and sha2 or similar functions) ensures that PII is protected before it is ever committed to storage. This maintains data privacy from the moment the data enters the ecosystem, preventing sensitive information from ever reaching the persistent Bronze table.

Why this answer

Implementing masking at the ingestion layer using Delta Live Tables (DLT) expectations or standard Spark transformations ensures that sensitive data is never written in plaintext to the Bronze layer. Applying transformations during the 'Acquisition' phase is a critical security practice, ensuring that governance requirements are met before data becomes available to analysts, thereby reducing the risk of accidental exposure and maintaining data privacy compliance across the pipeline.

Exam trap

Students mistakenly think PII data should be masked downstream in the Gold layer for final reporting, overlooking the critical compliance requirement to secure raw data early.

172
MCQmedium

A data engineering team is running a nightly batch job on a Databricks job cluster that processes a 10 TB Delta table. The job reads the entire table, performs transformations, and writes results to another Delta table. The team notices that the job takes 4 hours and consumes significant DBUs. They want to reduce runtime and cost without changing the business logic. The table is partitioned by ingestion date, but queries often filter on a high-cardinality column 'customer_id'. Which optimization technique is most appropriate to improve performance and reduce cost?

A.Enable Delta Lake caching by running CACHE TABLE on the source table before the job.
B.Increase the cluster size by adding more worker nodes to the job cluster.
C.Optimize file layout using Z-ORDER BY on the 'customer_id' column.
D.Convert the table to a Parquet table and use partition pruning on 'customer_id'.
AnswerC

Z-ORDER BY clusters data on the 'customer_id' column, improving data skipping for queries that filter on that column. This reduces the amount of data read during the nightly job, leading to faster runtime and lower DBU consumption. It is a cost-effective optimization because it reorganizes existing data without changing business logic, and the benefits persist across runs until the data is rewritten.

Why this answer

Z-ORDER BY on 'customer_id' colocates related data, enabling Delta Lake's data skipping to prune files during reads. This reduces I/O and compute, directly lowering runtime and DBU cost. Other options either increase cost, are impractical, or degrade performance.

The optimization is persistent and does not require changes to business logic, making it ideal for this scenario.

Exam trap

The trap here is assuming that adding more cluster resources or caching will solve performance issues without addressing data layout, which is often the root cause.

173
MCQmedium

You are processing sensitive PII data in a Delta table. You need to ensure that specific columns containing PII are not readable by general data analysts while maintaining the ability to perform aggregate analysis on those rows. Which feature should you implement?

A.Use the 'ALTER TABLE DROP COLUMN' command.
B.Apply Dynamic Views with functions like 'mask_hash' or 'case'.
C.Implement row-level security using Spark configurations.
D.Encrypt the entire storage bucket using cloud-native tools.
AnswerB

Dynamic Views allow the definition of access policies based on the session user's role or identity. By using functions such as masking or conditional logic, you can obscure PII for unauthorized users while keeping the underlying data intact for administrative roles or authorized analytical processes as required.

Why this answer

Databricks Unity Catalog provides robust data governance, including column-level security through Dynamic Views. By defining a view that masks or filters data based on the user's role, you ensure PII protection while allowing data exploration. Managing access control via Unity Catalog is a standard professional requirement for maintaining compliance (GDPR/CCPA) and ensuring that sensitive information remains secure within the enterprise data architecture.

Exam trap

Candidates often suggest column-level encryption or physical data removal. These are overkill and do not allow for the necessary aggregate analysis required by the prompt, whereas Dynamic Views provide the required flexibility.

174
MCQmedium

A data engineer is configuring a Unity Catalog external location to allow access to an S3 bucket. The security team requires that all access to the bucket be authenticated using a specific IAM role, and that the credentials not be stored in Databricks. Which Unity Catalog object should the engineer create to meet this requirement?

A.A storage credential that assumes the IAM role using AWS STS.
B.A storage credential that references the IAM role via an instance profile.
C.A service principal with an attached IAM role in AWS.
D.An external location that directly embeds the IAM role's access key and secret key.
AnswerA

A Unity Catalog storage credential encapsulates an IAM role that Databricks assumes using AWS STS to obtain temporary credentials. This avoids storing long-lived credentials in Databricks and allows the security team to control access via the IAM role's trust policy. It is the correct way to authenticate access to an S3 bucket from Unity Catalog.

Why this answer

Unity Catalog storage credentials are the correct object for authenticating to cloud storage. They reference an IAM role that Databricks assumes via AWS STS, providing temporary credentials without storing secrets. External locations then reference the storage credential and define the bucket path.

This design meets the requirement of using a specific IAM role and avoiding stored credentials.

Exam trap

The trap here is confusing instance profiles, which are used for cluster-level S3 access outside Unity Catalog, with storage credentials, which are the Unity Catalog mechanism for external locations.

175
MCQeasy

Which command should be used to display the history of transactions performed on a Delta table, including operations like overwrites and updates?

A.SHOW LOGS table_name
B.DESCRIBE HISTORY table_name
C.SELECT * FROM metadata.table_name
D.EXPLAIN EXTENDED table_name
AnswerB

This command returns the complete history of operations performed on the Delta table, including timestamps, operation types, user information, and version numbers. It is the primary tool for auditing Delta Lake changes and facilitating data recovery through time travel to previous table versions.

Why this answer

The 'DESCRIBE HISTORY' command is the standard way to inspect the transaction log of a Delta table. This is vital for auditing, time-travel debugging, and understanding the sequence of operations that led to the current state of the table. Understanding this command is essential for troubleshooting data quality issues and verifying that pipeline operations performed as expected during backfills or incremental loads.

Exam trap

Test-takers often confuse table metadata commands like 'DESCRIBE DETAIL' or 'SHOW TABLES' with the specific command needed to inspect transaction history logs.

176
MCQhard

A data engineer is implementing column-level masking in Unity Catalog. They need to mask the 'email' column in the table 'prod.customers' such that only members of the 'hr_group' see the full email, while all other users see a masked version. The engineer creates a masking function and applies it using ALTER TABLE. Which statement correctly applies the mask?

A.ALTER TABLE prod.customers ALTER COLUMN email SET MASK prod.security.mask_email;
B.ALTER TABLE prod.customers ALTER COLUMN email SET MASK FUNCTION prod.security.mask_email;
C.ALTER TABLE prod.customers ALTER COLUMN email SET MASK mask_email;
D.ALTER TABLE prod.customers MODIFY COLUMN email SET MASK prod.security.mask_email;
AnswerA

This statement correctly applies a column mask using the fully qualified function name. The syntax ALTER COLUMN ... SET MASK is valid in Unity Catalog, and referencing the function with catalog.schema.name ensures it is resolved correctly. The mask will be applied to all queries unless the user is a member of the group specified in the function's logic.

Why this answer

The correct syntax to apply a column mask in Unity Catalog is ALTER TABLE table_name ALTER COLUMN column_name SET MASK function_name, where function_name is a fully qualified function that returns the masked value. This ensures that the mask is applied consistently and only authorized users see the original data.

Exam trap

The trap here is using MODIFY COLUMN or adding the FUNCTION keyword, which are not part of the SET MASK syntax.

177
MCQeasy

Which metric should a data engineer prioritize when investigating a slow-running query in the Databricks SQL query history?

A.The number of users logged into the workspace at the time.
B.The total execution time and breakdown of the query stages.
C.The color of the query status light in the UI.
D.The name of the user who submitted the query.
AnswerB

The execution time breakdown helps isolate which part of the query is causing the slowdown (e.g., scanning, shuffling, or joining). This visibility is crucial for diagnosing the root cause—whether it is an inefficient join, lack of partitioning, or data skew—and is the first step in any performance optimization process.

Why this answer

The 'Total Time' metric is decomposed into wait time, compilation time, and execution time. Identifying the execution time bottleneck helps determine if the issue is compute-bound, I/O-bound, or due to slow data retrieval. This information is vital for deciding whether to optimize the query code, adjust partitioning, or scale the warehouse, ensuring that engineering efforts are targeted at the right performance issues to maximize impact.

Exam trap

Test-takers often focus on cluster CPU utilization alone, ignoring the query history execution time breakdown which exposes the exact stage causing bottlenecks.

178
Multi-Selecthard

A data engineer is investigating a job failure that occurred only in the production environment. Which TWO features in Databricks help in comparing the production environment to the development environment?

Select 2 answers
A.Use the 'View as JSON' feature in the Jobs UI to compare job configurations.
B.Use the 'Cluster Logs' to compare the OS kernel versions of the nodes.
C.Review the git branch history and configuration files in the CI/CD pipeline.
D.Enable the 'Debug Mode' on the Spark Driver to see raw system calls.
E.Query the 'workspace_users' table to see who ran the job last.
AnswersA, C

Exporting and comparing job JSON configurations is an effective way to identify discrepancies in parameters, cluster sizes, or timeout settings. This allows engineers to systematically check for configuration drift between the development workspace and the production workspace, which is a common source of environment-specific failures.

Why this answer

Comparing environment configurations is essential for troubleshooting parity issues. Databricks provides tools like the Jobs UI for export and version control integration for code, which help engineers identify subtle differences between environments. Ensuring parity is critical for reducing 'it works on my machine' scenarios.

By utilizing these tools, engineers can verify cluster settings, library versions, and code versions to isolate why a process fails in production but succeeds in development.

Exam trap

Candidates often suggest manual code comparison or running both jobs simultaneously. They fail to see that configuration parity is best verified via the Jobs UI export and standardized CI/CD version control.

179
MCQhard

Which property must be set to ensure a Spark Structured Streaming query can handle changes to the source data schema, such as adding a new column?

A.cloudFiles.inferSchema = 'false'
B.cloudFiles.schemaEvolutionMode = 'addNewColumns'
C.cloudFiles.maxFilesPerTrigger = 'auto'
D.cloudFiles.useIncrementalListing = 'true'
AnswerB

This specific mode instructs the Auto Loader to detect new columns in incoming data files and update the target table schema automatically. This is the recommended setting for production pipelines where the upstream source schema is expected to grow over time, ensuring continuous operation without manual schema management or pipeline restarts.

Why this answer

The `cloudFiles.schemaEvolutionMode` property allows the Auto Loader to adapt to schema changes automatically. In production streaming environments, this is vital because data sources often evolve over time. Without this, the streaming job would fail when it encounters a record that does not match the schema inferred at the start of the job, resulting in pipeline downtime and manual intervention to reset the state.

Exam trap

Candidates often select generic Spark options like 'mergeSchema' which applies to batch processing, instead of the specific Auto Loader configuration required for streaming schema evolution.

180
MCQmedium

A data engineer is optimizing a Delta Lake table that experiences high read latency due to many small files. Which command should be executed to physically reorganize the data layout to improve query performance?

A.VACUUM table_name
B.ANALYZE TABLE table_name COMPUTE STATISTICS
C.OPTIMIZE table_name
D.REORG TABLE table_name APPLY (PURGE)
AnswerC

OPTIMIZE triggers a compaction process that aggregates small files into larger, optimized Parquet files. This process significantly improves read performance by enabling better data skipping and reducing the overhead associated with listing and opening numerous tiny files, which is a common bottleneck in high-frequency Delta Lake write workloads.

Why this answer

The OPTIMIZE command is the primary tool for compacting small files into larger, efficiently sized files in Delta Lake. This improves read performance by reducing metadata overhead and enabling efficient data skipping. Compaction is a critical maintenance task for tables with frequent streaming or small-batch writes, ensuring that downstream analytical queries remain performant and cost-effective by reducing the number of I/O operations required during data retrieval.

Exam trap

Candidates often confuse OPTIMIZE with VACUUM. VACUUM only removes old files that are no longer referenced; it does not reorganize data or compact active files to improve performance.

181
MCQmedium

A data engineer deploys a Databricks Job that runs a notebook task. The notebook writes to a Delta table in Unity Catalog. The job fails with the error: 'PERMISSION_DENIED: User does not have USE CATALOG on catalog 'prod'.' The engineer confirms the job's service principal has USE CATALOG granted on the catalog. Which configuration should the engineer check next?

A.The notebook's default language setting
B.Whether the job is configured to run as the service principal or as a different user
C.The job cluster's Spark config for spark.databricks.acl.enabled
D.The cluster's autoscaling min and max worker counts
AnswerB

Unity Catalog privileges are evaluated against the identity that executes the job. If the job's run-as setting points to a user or a different service principal than the one granted USE CATALOG, the error appears even though the intended principal has the privilege. Confirming and correcting the run-as identity ensures the granted privileges are applied to the execution context.

Why this answer

Unity Catalog privileges are enforced based on the identity that executes the job. When a service principal has USE CATALOG but the job runs as a different user or principal, the error still occurs. Checking the job's run-as configuration and aligning it with the granted identity resolves the mismatch and allows the notebook to access the catalog.

Exam trap

The trap here is assuming the error always means the grant is missing, when in fact the job may be running as a different identity than the one that was granted privileges.

182
MCQhard

A data engineer is configuring a Delta Live Tables (DLT) pipeline that processes streaming data from Apache Kafka. The pipeline performs a series of transformations and writes to a Delta table. The engineer notices that the pipeline is experiencing high latency and wants to optimize it for cost and performance. The pipeline is set to continuous mode. Which configuration change is most effective to reduce cost while maintaining acceptable latency?

A.Increase the number of Kafka partitions to improve parallelism.
B.Configure the pipeline to use Photon-optimized clusters.
C.Switch the pipeline to triggered mode and schedule it to run every 5 minutes.
D.Enable autoscaling on the DLT cluster and set a minimum number of workers.
AnswerC

Triggered mode runs the pipeline only when triggered, rather than continuously. Scheduling every 5 minutes can reduce cost because the cluster is not always running, while still providing acceptable latency for many use cases. This is a common cost-saving measure for streaming pipelines that do not require sub-second latency. It also allows the cluster to shut down between runs, saving DBUs.

Why this answer

Switching from continuous to triggered mode with a 5-minute schedule reduces cost by allowing the cluster to shut down between runs. Continuous mode keeps the cluster running 24/7, incurring constant DBU charges. Triggered mode with a schedule balances latency and cost, making it the most effective change for reducing cost while maintaining acceptable latency.

Exam trap

The trap here is assuming that performance optimizations like increasing partitions or using Photon will reduce cost, when they may actually increase it due to higher resource consumption or DBU rates.

183
MCQhard

Refer to the exhibit. You are using Auto Loader to ingest data with evolving schemas. After running the job for a week, you realize that new columns added to the source JSON are not being captured in the destination table. What must you add to the configuration?

A.Add 'cloudFiles.schemaEvolutionMode': 'rescue'.
B.Add 'cloudFiles.schemaEvolutionMode': 'addCol'.
C.Add 'cloudFiles.maxFiles': '1000'.
D.Add 'cloudFiles.allowOverwrites': 'true'.
AnswerB

Setting schema evolution mode to 'addCol' enables the ingestion process to detect new columns in the source data and automatically add them to the target Delta table. This ensures the table structure remains synchronized with the incoming data stream, preventing the loss of new attributes arriving in source files.

Why this answer

By default, Auto Loader schema inference only detects the schema during the initial load. To capture schema evolution, you must explicitly enable 'cloudFiles.schemaEvolutionMode'. Without this parameter, Auto Loader ignores new fields to protect downstream consumers from breaking changes.

Enabling 'addCol' allows the schema to expand dynamically, ensuring the target Delta table reflects the structure of the incoming data files as they arrive.

Exam trap

Candidates tend to look for manual ALTER TABLE commands or checkpoint resets, forgetting that Auto Loader needs a specific configuration property for schema evolution.

184
MCQmedium

Which THREE of the following are essential components of an effective ingestion monitoring strategy in Databricks?

A.Monitoring the total number of files in the cloud storage bucket.
B.Tracking the 'numInputRows' metric in the streaming query progress.
C.Setting up alerts on failed expectations in DLT.
D.Using DLT event logs to analyze pipeline execution details.
E.Regularly restarting the cluster to clear cache.
AnswerB, C, D

This metric tells you how many records are being processed in each micro-batch. It is essential for detecting data spikes, identifying potential ingestion lags, and verifying that the volume of data flowing through the pipeline aligns with the expected source throughput, which helps in capacity planning and performance tuning.

Why this answer

Monitoring ingestion requires visibility into both infrastructure health and data quality. By tracking metrics like micro-batch latency, file processing rates, and record-level validation through expectations, you gain a holistic view of the pipeline. These components allow engineers to identify bottlenecks, respond to data quality drops, and ensure SLAs are met consistently, which is critical for maintaining reliable downstream analytics in a data lakehouse architecture.

Exam trap

Candidates often select generic infrastructure metrics like CPU usage or memory, missing that ingestion monitoring specifically requires data-level metrics like record processing rates and quality expectations.

185
Multi-Selectmedium

A data engineer is preparing to deploy a production Databricks workflow. Which TWO best practices should be implemented to ensure maintainability and robust error handling?

Select 2 answers
A.Hardcode credentials directly into the notebook for ease of access.
B.Use Databricks Git folders for version control of production code.
C.Configure email notifications for both job success and failure.
D.Avoid using libraries and rely only on built-in Spark functions.
E.Deploy code directly from the workspace to production.
AnswersB, C

Git folders provide essential version control functionality, allowing teams to manage code changes, handle merge requests, and maintain a history of deployments. This is fundamental for collaborative development and ensures that production code is peer-reviewed and consistent across different environments, preventing unauthorized or accidental changes.

Why this answer

Maintaining production environments requires strict adherence to modular code design and comprehensive observability. Using version control for notebooks and job configurations ensures that every change is tracked, audited, and reversible. Simultaneously, implementing robust notification alerts for job failures allows engineering teams to respond proactively to issues.

These two practices collectively minimize the risk of deployment errors and reduce the Mean Time to Resolution (MTTR) when unexpected failures occur in production pipelines.

Exam trap

Candidates frequently select 'manual code deployment' or 'cluster logging' instead of Git folders, mistakenly believing that basic dashboard monitoring is sufficient for production-grade code versioning and reliability.

186
MCQmedium

A data engineer supports a Delta Live Tables pipeline that ingests streaming data from Kafka. The pipeline sometimes experiences latency spikes, and the engineer needs to determine whether the bottleneck is in the ingestion stage or in downstream transformations. They want to use built-in observability without adding external tooling. Which approach provides the most direct insight into per-stage event processing times within the DLT pipeline?

A.Configure Databricks SQL alerts on the pipeline's target tables to detect latency by comparing row counts over time.
B.Monitor cluster CPU utilization in the Clusters UI and correlate spikes with pipeline run times.
C.Use the Spark UI's SQL tab to inspect query plans for each streaming micro-batch.
D.Enable the event log and query the event_log table for flow_progress events to inspect stage-level metrics such as backlog and processing time.
AnswerD

The DLT event log captures flow_progress events that include stage-level metrics, including backlog bytes and records, as well as processing time. Querying the event_log table directly surfaces these metrics without external tools, allowing the engineer to compare ingestion versus transformation stages and pinpoint where latency accumulates.

Why this answer

The event log is the built-in observability mechanism for Delta Live Tables. By querying flow_progress events, the engineer gains stage-level metrics that directly show backlog and processing time for each flow. This allows precise identification of whether ingestion or transformation is the source of latency, without deploying external monitoring tools.

Exam trap

The trap here is assuming that cluster CPU metrics or Spark UI query plans can reveal DLT stage-level timing, when only the event log exposes flow_progress details.

187
MCQhard

When troubleshooting a job that frequently crashes due to 'Out of Memory' (OOM) errors, which TWO metrics or logs should be analyzed?

A.Driver and Executor logs.
B.System table audit logs.
C.Spark UI Executor memory metrics.
D.Workspace usage billing reports.
E.The number of active sessions in the SQL warehouse.
AnswerA, C

Driver and executor logs contain the stack traces and error messages that specifically indicate memory exhaustion. Reviewing these logs allows the engineer to determine whether the error occurred during a shuffle operation, a broadcast join, or while loading a large data partition into memory.

Why this answer

Analyzing Spark UI metrics and cluster logs is critical for resolving OOM errors. Examining the 'JVM heap usage' and 'executor memory usage' helps identify if the data partition size exceeds available memory. Addressing these issues is essential for stabilizing production jobs, as OOM errors are a leading cause of pipeline failure, resulting in data gaps and missed SLAs that impact downstream business decisions.

Exam trap

Candidates often look only at cluster-level infrastructure metrics rather than examining the Spark UI memory metrics and driver/executor logs, missing the specific JVM heap usage details needed to resolve OOM errors.

188
Multi-Selectmedium

A Data Engineer is implementing column-level security on a Unity Catalog table `sales.customers` that contains `email`, `ssn`, and `region` columns. The requirement is that analysts in the `analyst` group see only the last four digits of `ssn` and a hashed `email`, while members of the `compliance` group see full values. The engineer plans to use column masks. Which TWO actions are required to meet the requirement? (Choose two.)

Select 2 answers
A.Grant the `analyst` group the `USE SCHEMA` privilege on the schema containing `sales.customers`.
B.Create a masking function that inspects the invoking user's group membership and returns either the full value or a masked value.
C.Apply the masking function to the `ssn` and `email` columns using ALTER TABLE ... ALTER COLUMN ... SET MASK.
D.Revoke SELECT on the `ssn` and `email` columns from the `analyst` group before applying the mask.
E.Create a row filter function that returns TRUE only for rows where the user belongs to the `compliance` group.
AnswersB, C

A column mask function can branch on the current user's groups using functions such as `is_account_group_member`, returning the raw value for `compliance` and a masked value for everyone else. This centralizes the logic and ensures analysts receive only the truncated SSN or hashed email while compliance sees full data. Without this conditional function, the mask cannot differentiate the two groups.

Why this answer

Column masks require two things: a function that decides the returned value based on the invoking user's groups, and the ALTER TABLE statement that binds that function to each sensitive column. Together they let analysts see truncated SSN and hashed email while compliance sees full values. Revoking column SELECT breaks queries, row filters hide rows instead of transforming values, and USE SCHEMA is only a prerequisite.

Exam trap

The trap here is treating column masks as an access denial mechanism and revoking column SELECT, when masks are meant to transform values while SELECT remains granted.

189
MCQeasy

A data engineer needs to read a CSV file from cloud storage into a Spark DataFrame in Databricks. The file has a header row and uses commas as delimiters. The engineer wants to infer the schema automatically. Which code snippet correctly reads the file?

A.spark.read.format("csv").option("header", "true").option("inferSchema", "true").load("path/to/file.csv")
B.spark.read.option("format", "csv").option("header", "true").option("inferSchema", "true").load("path/to/file.csv")
C.spark.read.csv("path/to/file.csv").option("header", "true").option("inferSchema", "true")
D.spark.read.format("csv").load("path/to/file.csv", header=True, inferSchema=True)
AnswerA

This correctly specifies the CSV format, sets header to true to use the first row as column names, and inferSchema to true to automatically detect data types. The load method reads the file. This is the standard way to read CSV with schema inference in Spark.

Why this answer

The correct method chain uses spark.read.format("csv") to specify the format, then .option("header", "true") and .option("inferSchema", "true") to set the options, and finally .load(path). This is the standard and correct way to read a CSV file with schema inference in Spark.

Exam trap

The trap here is using the wrong method order or passing options as arguments to load instead of using the option method.

190
MCQmedium

An organization requires that all data stored in their S3 bucket used by Databricks be encrypted using a Customer Managed Key (CMK). Which configuration must be performed to meet this requirement?

A.Enable server-side encryption with S3-managed keys (SSE-S3).
B.Configure the workspace to use a Customer Managed Key for DBFS root.
C.Set the encryption policy in the Spark configuration of every cluster.
D.Apply an IAM role to the storage bucket that restricts access to the root user.
AnswerB

Configuring the Databricks workspace to use a Customer Managed Key for the DBFS root ensures that all data stored in the default storage location is encrypted with your specific KMS key. This fulfills the compliance requirement by centralizing the cryptographic control of data at the root storage level.

Why this answer

When using Customer Managed Keys (CMK) for storage encryption, the Databricks environment must be configured with the appropriate IAM policies and KMS key grants. This ensures that the Databricks compute resources have the necessary permissions to perform cryptographic operations. Configuring this correctly at the storage and workspace level is essential for compliance with data protection standards like HIPAA or GDPR.

Exam trap

Candidates mistakenly select standard table-level encryption or application-level settings instead of the workspace-level configuration required for DBFS root encryption.

191
MCQeasy

A data engineer is asked to implement column-level masking for a Unity Catalog table `main.hr.employees` that contains a column `ssn` with Social Security numbers. The requirement is that only members of the `hr_group` should see the full SSN, while all other users should see only the last four digits (e.g., XXX-XX-1234). The engineer decides to use a column mask function. Which statement accurately describes how to apply the mask?

A.Use row-level filters to exclude rows where the user is not in hr_group, effectively hiding sensitive data.
B.Create a view that selects all columns except ssn, and a separate view that includes ssn for hr_group, then grant appropriate privileges on each view.
C.Create a function that returns the masked value based on IS_MEMBER('hr_group'), then use ALTER TABLE ... ALTER COLUMN ssn SET MASK function_name.
D.Grant SELECT on the ssn column only to hr_group, and revoke it from all other users.
AnswerC

Unity Catalog supports column masks via a user-defined function that dynamically returns a value based on the invoking user's group membership. The function can use IS_MEMBER to check if the user belongs to hr_group and return the full SSN or a masked version accordingly. The mask is applied using ALTER TABLE ... ALTER COLUMN ... SET MASK, which attaches the function to the column. This approach enforces the masking at query time for all users except those in the specified group.

Why this answer

Column masks in Unity Catalog are implemented via user-defined functions that can dynamically return different values based on the user's group membership. The function can use IS_MEMBER to check if the user is in hr_group and return either the full SSN or a masked version. The mask is attached to the column using ALTER TABLE ...

ALTER COLUMN ... SET MASK. This enforces masking for all users except those in the specified group, meeting the requirement.

Exam trap

The trap here is thinking that column-level grants or views can provide dynamic masking, when only a column mask function can return different values based on the user.

192
MCQmedium

What is the primary benefit of using Unity Catalog for data federation?

A.It eliminates the need for any network configuration.
B.It provides a single security model for all data sources.
C.It automatically converts all external data to Delta format.
D.It allows the SQL Warehouse to run entirely on the external database.
AnswerB

Unity Catalog abstracts the security differences between various data sources. Whether you are querying a PostgreSQL database, a Snowflake instance, or internal Delta tables, you use the same Unity Catalog permission syntax. This dramatically reduces the administrative overhead and potential for configuration errors across a complex multi-source data landscape.

Why this answer

Unity Catalog acts as a centralized governance layer that provides a unified namespace for both local and external data. By using Unity Catalog, organizations can apply consistent security policies, such as column-level masking or row-level filtering, to federated data sources. This allows users to access disparate systems through a single, secure interface without learning unique security models for each data source.

Exam trap

Candidates often assume data federation improves raw query performance or optimizes storage costs, missing that its primary value lies in centralized security governance.

193
MCQhard

Your team is using a shared cluster for development. A user reports that their job is slow because the cluster memory is frequently filled by large data broadcasts. What configuration adjustment should you make to prevent this issue across all jobs on the cluster?

A.Increase 'spark.driver.memory'.
B.Decrease the 'spark.sql.autoBroadcastJoinThreshold'.
C.Increase the number of shuffle partitions.
D.Enable 'spark.sql.adaptive.enabled'.
AnswerB

Reducing this threshold prevents the optimizer from choosing a broadcast join for tables that are larger than the specified limit. By forcing the engine to use a sort-merge join instead, you ensure that the memory stays within safe limits, preventing OOM errors on shared clusters where resources are finite.

Why this answer

Controlling the broadcast threshold prevents Spark from automatically attempting to broadcast large tables that exceed the available memory, which is the most common cause of OOMs on shared clusters. Setting this value correctly ensures that only appropriately small tables are broadcast, forcing the engine to use a join shuffle instead. This maintains stability for all users on the shared cluster, preventing one user's job from impacting others.

Exam trap

Candidates often try to increase cluster memory or change instance types. While this might temporarily fix the symptom, it doesn't address the root cause of Spark attempting to broadcast tables that are too large.

194
MCQhard

When running a PySpark job, you receive an 'Out of Memory (OOM)' error during a shuffle operation. Which configuration is the most appropriate to address this first?

A.Increase spark.driver.memory
B.Increase spark.sql.shuffle.partitions
C.Decrease spark.executor.memory
D.Set spark.sql.shuffle.partitions to 1
AnswerB

Increasing the number of shuffle partitions is the standard way to reduce the amount of data processed per task. By splitting the work across more partitions, each task consumes less memory, which helps resolve OOM issues occurring during shuffle-heavy operations like joins and aggregations.

Why this answer

OOM errors during shuffles are frequently caused by partitions that are too large for the executor's memory. Increasing 'spark.sql.shuffle.partitions' is the primary corrective action, as it splits the data into a larger number of smaller partitions. This reduces the memory footprint of each individual task, allowing them to fit within the executor's heap memory and preventing the job from crashing due to memory exhaustion during data movement.

Exam trap

Candidates often choose increasing executor memory or cluster size first. While these might work, they are inefficient and costly compared to tuning shuffle partitions to reduce the memory footprint per task.

195
MCQmedium

A data engineer is ingesting data from an Azure SQL Database into a Delta Lake table using the JDBC connector in a Databricks notebook. The source table contains millions of rows, and the engineer wants to optimize the ingestion by reading the data in parallel. The source table has a numeric primary key column named 'id' that is evenly distributed. Which approach should the engineer use to achieve parallel reads?

A.Set the 'fetchsize' option to a large value to increase the number of rows retrieved per round trip.
B.Use the 'query' option with a custom SQL statement that includes a 'WHERE' clause with modulo arithmetic to split the data.
C.Specify the 'partitionColumn', 'lowerBound', 'upperBound', and 'numPartitions' options in the JDBC read configuration.
D.Enable 'spark.sql.adaptive.enabled' to automatically parallelize the JDBC read.
AnswerC

The JDBC connector supports parallel reads by partitioning the data based on a numeric column. By specifying partitionColumn (e.g., 'id'), along with lowerBound, upperBound, and numPartitions, Spark divides the query into multiple partitions that can be read concurrently. This significantly speeds up ingestion for large tables. The column must be numeric and evenly distributed, which 'id' satisfies. This is the correct approach for parallel JDBC reads.

Why this answer

To read a large JDBC table in parallel, you must configure the JDBC connector with partitioning options: partitionColumn, lowerBound, upperBound, and numPartitions. The partitionColumn must be numeric, and the bounds define the range for partitioning. Spark then creates multiple tasks to read the data concurrently.

This is the standard method for parallelizing JDBC reads in Databricks.

Exam trap

The trap here is thinking that increasing fetchsize or enabling adaptive query execution will parallelize the JDBC read, when in fact only explicit partitioning options create multiple concurrent tasks.

196
MCQhard

A data engineer is using Lakehouse Federation to query a PostgreSQL database. The engineer notices that a query filtering on a column with a high cardinality is performing poorly, even though the remote database has an index on that column. What is the most likely reason for the poor performance?

A.The PostgreSQL database is not configured with the correct statistics, causing the query planner to choose a sequential scan.
B.The foreign catalog is using a JDBC connection with a small fetch size, causing many round trips to the database.
C.The foreign catalog is not configured to allow predicate pushdown for the PostgreSQL database.
D.The filter condition uses a function or expression that cannot be pushed down to PostgreSQL, causing a full table scan.
AnswerD

Lakehouse Federation pushes down simple predicates like equality and range filters. However, if the filter uses a function or expression that PostgreSQL cannot evaluate, such as a complex UDF or a non-deterministic function, the pushdown fails. Databricks then retrieves all rows and applies the filter locally, ignoring the remote index. This results in a full table scan and poor performance. The engineer should rewrite the query to use pushdown-compatible expressions.

Why this answer

Poor performance on a filtered query against a federated PostgreSQL database often indicates that the filter was not pushed down. If the filter uses an expression that PostgreSQL cannot evaluate, Databricks retrieves all data and filters locally, bypassing the remote index. The engineer should simplify the filter or use pushdown-compatible expressions to leverage the index and improve performance.

Exam trap

The trap here is blaming the remote database's statistics or configuration, when the issue is that the filter expression prevents predicate pushdown from Databricks to PostgreSQL.

197
Multi-Selectmedium

A data engineer is debugging a Databricks job that fails with a `SparkException: Job aborted due to stage failure` in production. They need to identify the root cause. Which two actions should they take to gather relevant diagnostic information? (Choose two.)

Select 2 answers
A.Review the Spark driver logs for the failed job run in the Databricks Jobs UI.
B.Run the job locally with a small sample of data to reproduce the error.
C.Examine the event log for the job cluster to see if nodes were terminated unexpectedly.
D.Check the cluster's init script logs to see if a library installation failed.
E.Inspect the Spark UI for the failed stage to identify skewed tasks or spills.
AnswersA, E

The Spark driver logs contain detailed error messages, including the stage that failed and the exception stack trace. This is the first place to look for root cause. The logs are accessible from the job run's detail page and provide context about the failure, such as data issues or resource problems.

Why this answer

To debug a Spark stage failure, the driver logs provide the exception details, and the Spark UI offers performance metrics that reveal issues like skew or spills. Together, they help identify whether the failure is due to data, code, or resource problems. The other actions are either for different error types or less direct for this specific failure.

Exam trap

The trap here is overlooking the Spark UI in favor of only logs, missing critical performance metrics that explain why the stage failed.

198
MCQmedium

A data engineer is using PySpark to cleanse a large dataset of customer records. The DataFrame `df` contains a string column `phone` with values like '123-456-7890', '(123) 456-7890', and '1234567890'. The engineer needs to standardize these to digits only (e.g., '1234567890'). Which transformation should be used?

A.df.withColumn('phone_clean', split('phone', '[^0-9]'))
B.df.withColumn('phone_clean', translate('phone', '-() ', ''))
C.df.withColumn('phone_clean', regexp_replace('phone', '[^0-9]', ''))
D.df.withColumn('phone_clean', trim('phone'))
AnswerC

The regexp_replace function replaces all non-digit characters with an empty string, effectively removing hyphens, parentheses, and spaces. This standardizes the phone numbers to a contiguous digit string, which is the desired outcome. It operates on the column 'phone' and creates a new column 'phone_clean' without modifying the original data, aligning with typical cleansing practices.

Why this answer

To standardize phone numbers to digits only, all non-digit characters must be removed. The regexp_replace function with the pattern '[^0-9]' efficiently replaces any character that is not a digit with an empty string, resulting in a clean digit-only string. This method is robust and handles various formats without complex string manipulation.

Other functions like translate or split do not directly produce the desired output.

Exam trap

The trap here is assuming that translate can remove characters by mapping them to an empty string, but translate requires equal-length mapping strings and will not work as intended for removal.

199
MCQmedium

When designing a production-grade data pipeline in Databricks, what is the recommended approach for managing secrets such as database credentials?

A.Store credentials in a public GitHub repository.
B.Use the dbutils.secrets.get() method to retrieve credentials at runtime.
C.Pass credentials as environment variables via cluster initialization scripts.
D.Encrypt credentials using a local Python library and save them to a file.
AnswerB

The 'dbutils.secrets.get()' method is the standard, secure way to access secrets stored within the Databricks Secret Scope. This keeps sensitive information out of the notebook text, allowing for secure integration with external systems while providing centralized management and auditing of secret usage within the Databricks platform's security framework.

Why this answer

Hardcoding credentials in notebooks is a severe security risk. Databricks Secrets provides a centralized, secure way to store and manage sensitive information. By referencing secrets via the 'dbutils.secrets.get()' API, credentials are kept out of the source code and version control.

This approach ensures that secrets can be rotated without modifying code and restricts access to those specifically authorized to view them through the Databricks access control policies.

Exam trap

Many candidates mistakenly select environment variables or hardcoded config files, forgetting that Databricks provides a dedicated secure utility for managing runtime secrets.

200
Multi-Selecthard

A data engineering team is modeling a large Delta Lake fact table that stores clickstream events. Analysts frequently run queries that filter by event_date and then aggregate by user_id, and the table receives continuous appends plus occasional late-arriving corrections. The team wants to reduce bytes scanned and improve join performance. Which two design choices are most appropriate? (Choose two.)

Select 2 answers
A.Convert the table to a Parquet external table and rely on the query engine to infer partitioning
B.Partition the table by event_date and apply Z-ORDER on user_id within each partition
C.Use liquid clustering on event_date and user_id instead of traditional Hive-style partitioning
D.Enable Change Data Feed on the table so late-arriving corrections are captured automatically
E.Partition the table by user_id to maximize file skipping for user-level aggregations
AnswersB, C

Partitioning by event_date enables partition pruning so queries filtering on a date range skip unrelated files, while Z-ORDER on user_id co-locates related user rows within each partition's files. Together they reduce bytes scanned for both the date filter and the user aggregation, and Z-ORDER statistics let Delta skip files whose user_id min/max ranges fall outside the predicate.

Why this answer

The workload filters on event_date and aggregates by user_id, so layout must accelerate both. Partitioning by event_date with Z-ORDER on user_id gives reliable partition pruning plus co-located user data, while liquid clustering on both columns achieves similar skipping without rigid high-cardinality directories and can be adapted incrementally as access patterns change.

Exam trap

The trap here is reaching for a high-cardinality partition column like user_id, which feels aligned with the aggregation but in practice creates a small-file problem and does nothing for the dominant date filter.

201
MCQmedium

A data engineer is reviewing a Databricks job that runs a notebook to process a large Delta table. The job takes 45 minutes, and the engineer notices that the cluster spends a significant amount of time in the 'Pending' state before execution begins. The cluster is a job cluster with autoscaling enabled and no cluster pool. The engineer wants to reduce the overall job duration and cost. Which action should the data engineer take?

A.Increase the maximum number of workers in the autoscaling configuration to 32 so the cluster scales up faster.
B.Switch the job to use a serverless job compute environment, which eliminates cluster startup time.
C.Enable a cluster pool and attach the job cluster to it so that instances are pre-provisioned and startup time is reduced.
D.Reduce the cluster's autoscaling minimum workers to 1 to lower cost, and accept the longer startup.
AnswerC

Cluster pools keep a set of idle instances ready, so when the job starts, the cluster can acquire instances quickly instead of waiting for cloud VM provisioning. This directly reduces the 'Pending' time and shortens the job duration. The pool does incur some idle cost, but for a job that runs frequently and has significant startup overhead, the reduction in runtime and the ability to use smaller clusters can offset that cost.

Why this answer

The 'Pending' state indicates the cluster is waiting for cloud instances to be provisioned. A cluster pool pre-provisions instances so they are ready when the job starts, which reduces the time spent waiting and shortens the overall job duration. While pools have some idle cost, for a frequently running job with significant startup overhead, the reduction in runtime and the ability to use right-sized clusters often results in net savings.

Increasing max workers or reducing min workers does not address provisioning delay.

Exam trap

The trap here is assuming that autoscaling settings affect initial cluster startup, when in fact they only control scaling after the cluster is running.

202
MCQmedium

Refer to the exhibit. A data engineer is deploying a production pipeline that references a table in the default schema. The job fails with the provided error. What is the root cause?

A.The cluster is running an outdated version of the Spark runtime.
B.The job is running under a service principal that lacks permissions to the Hive Metastore.
C.The table exists only in the temporary session catalog of a different notebook.
D.The cluster has insufficient memory to load the table metadata.
AnswerC

Temporary views or tables created in interactive notebook sessions are not persisted in the shared Hive Metastore and are scoped to the session. Since the job runs in a separate, isolated environment, it cannot access objects defined in the transient memory of a different interactive session.

Why this answer

The error indicates that the Spark session cannot resolve the table 'default.sales_data'. In Databricks, jobs often run in a different environment or context than an interactive notebook. If the table was created in an interactive session, it might not exist in the environment where the job runs, or the database context is missing.

This highlights the importance of using absolute paths or proper schema initialization in production code.

Exam trap

Test-takers often assume local temporary views or notebook session-scoped tables persist automatically when the code is deployed as a production job.

203
MCQmedium

A data engineer is developing a PySpark job that reads a large Delta table, performs a groupBy on a high-cardinality column, and writes the result to another Delta table. The job is experiencing performance issues due to data skew. The engineer wants to optimize the shuffle by using salting. Which approach correctly implements salting to distribute the skewed keys evenly?

A.Use repartition on the skewed column before the groupBy to increase parallelism.
B.Add a random salt column to the DataFrame, group by the salted column, then remove the salt and re-aggregate.
C.Use broadcast join instead of groupBy to avoid the shuffle.
D.Set spark.sql.adaptive.enabled to true and rely on Adaptive Query Execution to handle skew automatically.
AnswerB

Salting involves adding a random suffix to the skewed key to distribute it across partitions. The approach of adding a salt, grouping by the salted key, then removing the salt and re-aggregating is a standard technique. It ensures even distribution during the shuffle and correct final aggregation. This is the correct implementation for mitigating skew.

Why this answer

Salting is a technique to distribute skewed keys by appending a random salt to the key before the shuffle, then grouping by the salted key, and finally removing the salt and re-aggregating to get the correct results. This spreads the load of a hot key across multiple partitions. The other options do not correctly implement salting or fail to address the skew.

Exam trap

The trap here is thinking that repartitioning on the skewed column or relying solely on Adaptive Query Execution will resolve severe skew, when salting is often required for even distribution.

204
MCQeasy

A data engineer wants to monitor the health of a Delta Live Tables pipeline and receive alerts when the pipeline fails to meet its data quality expectations. The pipeline has several expectations defined. Which Databricks feature should the engineer use to set up these alerts?

A.Job notifications configured on the DLT pipeline's underlying job.
B.Databricks SQL dashboard with a query on the target Delta table.
C.Delta Live Tables event log with Databricks SQL alerts.
D.Cluster metrics in the Databricks workspace.
AnswerC

The Delta Live Tables event log records data quality metrics and expectation outcomes. By querying the event log with Databricks SQL alerts, engineers can set up notifications when expectations fail or metrics drop below thresholds. This is the native and most integrated way to monitor DLT pipeline health and data quality.

Why this answer

The Delta Live Tables event log captures detailed data quality metrics and expectation results. By using Databricks SQL alerts to query this log, engineers can set up precise alerts for data quality violations. Other options either lack the necessary data quality context or only provide high-level failure notifications.

Exam trap

The trap here is assuming that job notifications or cluster metrics can alert on data quality expectations, when only the DLT event log contains that granular information.

205
Multi-Selecthard

A data engineer is implementing fine-grained access control on a Delta table in Unity Catalog that contains sensitive customer data. The requirement is to mask the `credit_card` column for all users except members of the `finance` group, and to filter out rows where the `region` column is not in the user's allowed regions. Which two Unity Catalog features should the engineer use? (Choose two.)

Select 2 answers
A.Table ACLs that grant SELECT only on specific columns.
B.Workspace-level IP access list to restrict access to the table.
C.Row filter using a SQL UDF that checks the user's allowed regions against the `region` column.
D.Dynamic view that joins the table with a mapping table of user regions.
E.Column mask using a SQL UDF that returns the masked value unless the user is in the `finance` group.
AnswersC, E

Row filters in Unity Catalog apply a SQL UDF that evaluates per row and returns a boolean, allowing you to restrict which rows are visible. This is the correct feature to filter out rows where the `region` is not in the user's allowed regions, based on the invoking user's identity or group membership.

Why this answer

Unity Catalog provides native row filters and column masks for fine-grained access control. A column mask with a SQL UDF can conditionally reveal or obscure the credit card column based on group membership, while a row filter with a SQL UDF can restrict rows by region. Together they implement the required masking and filtering directly on the table without requiring a separate view.

Exam trap

The trap here is assuming that table ACLs support column-level grants, when Unity Catalog achieves column-level security through column masks or views, not through GRANT on individual columns.

206
MCQmedium

A data engineer is configuring a Databricks SQL warehouse to handle a workload that consists of many concurrent short queries during business hours and almost no queries at night. The engineer wants to minimize cost while ensuring low latency during peak hours. Which configuration should the engineer use?

A.Use a serverless SQL warehouse with auto-stop disabled to avoid cold starts.
B.Use a classic SQL warehouse with auto-scaling enabled and auto-stop set to 5 minutes.
C.Use a classic SQL warehouse with a fixed cluster size and auto-stop set to 60 minutes.
D.Use a serverless SQL warehouse with auto-stop set to 10 minutes and auto-scale enabled.
AnswerD

Serverless SQL warehouses automatically scale based on query load and can stop when idle, so they incur cost only when running queries. Setting auto-stop to 10 minutes ensures the warehouse shuts down quickly after the last query, minimizing idle cost. Auto-scaling handles concurrency during peak hours, providing low latency without over-provisioning.

Why this answer

A serverless SQL warehouse with auto-stop and auto-scaling provides the best balance: it scales up for concurrency during peak hours, scales down and stops when idle, and charges only for usage. The short auto-stop minimizes idle cost, while auto-scaling ensures low latency. Other options either incur idle cost or cannot handle variable concurrency efficiently.

Exam trap

The trap here is assuming that disabling auto-stop is necessary to avoid cold starts, but serverless warehouses start quickly and idle cost outweighs the benefit.

207
MCQhard

A Data Engineer needs to encrypt data at rest within a Databricks workspace that uses a customer-managed key (CMK). What is the primary purpose of this configuration?

A.To increase the read throughput of Delta tables.
B.To enable transient data encryption for cluster nodes.
C.To control the lifecycle of the encryption keys used for storage.
D.To bypass the need for Unity Catalog permissions.
AnswerC

The primary purpose of CMK is to allow the organization to manage the lifecycle of encryption keys. This includes rotation policies and the ability to immediately revoke access to the storage account, ensuring that the cloud provider cannot access the data without the customer's active cooperation.

Why this answer

Using a customer-managed key (CMK) provides an additional layer of security and control over data at rest in cloud storage, such as S3 or ADLS. By managing the key in the cloud provider's Key Management Service (KMS), the organization can revoke access to the data at any time by disabling the key. This is a common requirement for high-compliance industries that need verifiable control over their encrypted data.

Exam trap

Candidates often confuse CMK with data-in-transit encryption (TLS) or think it is primarily for performance acceleration. They miss that CMK is strictly about administrative control over encryption key lifecycles.

208
MCQmedium

Refer to the exhibit. An engineer has configured the cluster settings as shown. What is the expected impact on the Delta table's performance and write operations?

A.Write latency will increase, but read performance will remain unaffected.
B.Read performance will improve over time as files are automatically compacted and optimized for downstream queries.
C.Storage costs will increase significantly due to the creation of temporary duplicate data files.
D.The cluster will fail to start because these configurations are deprecated in recent Databricks runtimes.
AnswerB

These settings ensure that files are written at optimal sizes and that small files are consolidated after writes. This results in a cleaner data layout that facilitates more efficient data skipping and reduced I/O, directly leading to better read performance for end-users and BI tools querying the Delta table.

Why this answer

The settings `optimizeWrite` and `autoCompact` are crucial for maintaining healthy Delta tables. `optimizeWrite` rearranges data for optimal file size before writing, while `autoCompact` automatically merges small files after writes. These configurations reduce the need for manual maintenance, lower storage costs, and ensure read queries perform optimally by preventing file fragmentation. This proactive approach is standard practice for high-performance Delta Lake implementations that minimize manual intervention.

Exam trap

Candidates often mistakenly believe these settings increase write latency significantly or require manual intervention to trigger, ignoring that they are automated, asynchronous background processes designed for long-term read efficiency.

209
MCQmedium

A Data Engineer wants to monitor data quality trends over time for a critical table. Which tool provides the most native and easy-to-use visualization of these metrics?

A.Export all data quality logs to an external S3 bucket and use a third-party BI tool.
B.Create a Databricks SQL dashboard using the 'expectations' table provided by DLT.
C.Write a custom Spark job to parse the Delta transaction log and send alerts via email.
D.Manually query the 'information_schema' every hour to track table row counts.
AnswerB

DLT automatically generates system tables that store the results of all quality expectations. These tables are readily available for querying via Databricks SQL, making it the fastest and most efficient way to visualize quality trends natively within the platform, without needing extra infrastructure or complex integrations.

Why this answer

Delta Lake's integration with Databricks SQL and DLT provides native dashboards that track data quality metrics automatically. Using Expectation history logs, engineers can visualize failure rates and quality trends without building custom monitoring solutions. This visibility is essential for proactive maintenance, allowing teams to catch degrading data quality before it impacts critical downstream business reporting, ensuring higher service levels for end-users.

Exam trap

Candidates often assume they must build custom dashboards using external tools like Grafana or Power BI, failing to realize that Databricks SQL provides built-in, native visualization capabilities specifically for DLT quality metrics.

210
MCQmedium

An organization needs to share a dataset with a client who does not use Databricks. What is the most efficient and secure way to share this data using Unity Catalog?

A.Export the data to CSV and upload it to a public FTP server.
B.Use Delta Sharing with an open sharing provider.
C.Grant the client read-only access to a dedicated Databricks workspace.
D.Create a public API endpoint that queries the table for the client.
AnswerB

Delta Sharing is the industry-standard, secure protocol for data sharing. It supports both Databricks and non-Databricks recipients, allowing for seamless integration. Because it works at the protocol level, it avoids the security risks of copying data and ensures that the provider retains full control over the shared assets.

Why this answer

Delta Sharing is an open-standard protocol that allows sharing data with any recipient, regardless of their platform or environment. By using Unity Catalog to share data, the organization maintains centralized governance and audit trails while enabling the recipient to consume the data using familiar tools. This approach is highly efficient because it avoids the need for data duplication and ensures the recipient always accesses the most current version.

Exam trap

Candidates often suggest exporting data to CSV or Parquet files for the client. This is insecure, creates data silos, and loses the benefit of centralized governance and audit logs.

211
MCQhard

You are performing a complex data transformation involving a self-join on a large, skewed table. Which technique is most effective for preventing data skew and improving join performance?

A.Increase the number of executors in the cluster to handle the load.
B.Use the 'repartition' hint on the join keys to force uniform distribution.
C.Apply a 'salt' to the join key to redistribute the skewed data across more partitions.
D.Convert the join into a broadcast join to prevent shuffling entirely.
AnswerC

Salting adds a random factor to the join key, which breaks up the large, heavy partitions caused by skewed values. By distributing the data across more executors, you ensure that no single task is overwhelmed, which is the most effective way to eliminate skew and improve join performance.

Why this answer

Skewed joins are a primary cause of performance failure in distributed computing. Using a 'salted' key—adding a random prefix to the join key—distributes data evenly across partitions during the join. This prevents 'hot' partitions where one executor processes the majority of the data, significantly speeding up the query and preventing OOM (Out of Memory) errors, ensuring consistent performance for large-scale analytical tasks.

Exam trap

Candidates often suggest increasing cluster size or memory, which fails to address the underlying data distribution problem causing skewed partitions in the join operation.

212
MCQmedium

You are designing an ingestion pipeline that must handle massive bursts of data at irregular intervals. Which feature should you prioritize to ensure the ingestion process remains cost-effective?

A.Use a fixed-size cluster with a large number of nodes.
B.Use auto-scaling clusters with a minimum of zero workers.
C.Run the pipeline continuously on a single-node cluster.
D.Increase the 'spark.sql.shuffle.partitions' to 10000.
AnswerB

Auto-scaling is the primary tool for managing bursty workloads. Setting the minimum to zero allows the cluster to shut down completely when no ingestion tasks are pending, effectively reducing costs to near zero. When data arrives, the cluster scales up automatically, ensuring throughput requirements are met during high-traffic periods.

Why this answer

Using Photon-accelerated clusters with auto-scaling is the most effective way to handle bursty workloads. By configuring the cluster to scale out when the queue of files is large and scale down during idle periods, you maximize resource utilization. This approach ensures you have enough compute to meet latency SLAs during bursts while minimizing costs by scaling to zero or minimal size when no data is being ingested, optimizing for both performance and budget.

Exam trap

Candidates often suggest fixed-size clusters to save money, ignoring that auto-scaling is essential for cost-effectively managing the irregular, bursty nature of the described workload.

213
MCQeasy

A data engineer is reviewing the cost of a Databricks job that runs on a daily basis. The job uses an all-purpose cluster that is manually started and stopped by the engineer. The job typically runs for 30 minutes, but the engineer often forgets to stop the cluster, leading to hours of idle time. Which action should the engineer take to reduce cost?

A.Increase the cluster's auto-stop threshold to 60 minutes to avoid premature termination.
B.Use a job cluster instead of an all-purpose cluster for the job.
C.Schedule the cluster to start and stop at specific times using a cron expression.
D.Configure the cluster to auto-stop after 30 minutes of inactivity.
AnswerB

Job clusters are created when a job starts and terminated when the job completes, eliminating idle time. They are billed at a lower rate than all-purpose clusters and are designed for automated workloads. This directly addresses the issue of forgotten clusters and reduces cost significantly. It also simplifies management, as the cluster lifecycle is tied to the job run.

Why this answer

Job clusters are purpose-built for automated jobs and terminate automatically when the job completes, eliminating idle time. They are also cheaper than all-purpose clusters. This directly solves the problem of forgotten clusters and reduces cost, unlike auto-stop thresholds or scheduling, which are workarounds.

Exam trap

The trap here is relying on auto-stop or manual scheduling to manage cluster lifecycle, when using a job cluster is the designed solution for automated workloads.

214
MCQmedium

When ingesting data from a Kafka topic into Delta Lake, what is the best way to handle out-of-order data arriving in the stream?

A.Disable all aggregations to avoid processing errors.
B.Implement a watermark on the event time column.
C.Increase the 'spark.sql.shuffle.partitions' to 5000.
D.Use the 'Trigger.Once' execution mode.
AnswerB

Watermarking allows you to specify the maximum threshold for data lateness. Records arriving within this window are processed correctly, while data arriving later is dropped. This mechanism provides a mathematically sound way to balance correctness and system memory usage, effectively handling out-of-order data streams in a distributed environment.

Why this answer

In streaming systems, data can arrive delayed. Using Watermarking allows the system to define a threshold for how long it will wait for late data. By keeping state for the specified duration, the engine can correctly aggregate or join records that arrived out of order.

This is a standard and essential technique in Spark Structured Streaming to ensure the accuracy of time-windowed operations in high-throughput environments.

Exam trap

Candidates often propose using windowing functions or sorting the entire dataframe, which are inefficient and do not correctly handle the state management required for streaming late-arriving data.

215
MCQmedium

A data engineer is configuring a Unity Catalog external location to securely access data in an AWS S3 bucket. The engineer has already created an IAM role with the necessary permissions and configured the storage credential. Which additional step is required to allow Databricks to access the S3 bucket?

A.Generate a personal access token (PAT) for the IAM role and store it in Databricks secrets.
B.Configure the S3 bucket policy to allow access from the Databricks control plane's IP addresses.
C.Attach the IAM role directly to the Databricks workspace's EC2 instances so they can assume the role.
D.Create an external location that references the storage credential and the S3 bucket path, then grant appropriate privileges on the external location.
AnswerD

An external location combines a storage credential with a cloud storage path. After creating the storage credential, you must create an external location that points to the S3 bucket path and uses that credential. Then, you grant privileges like CREATE EXTERNAL TABLE or READ FILES on the external location to users or groups. This is the required step to enable access.

Why this answer

After creating a storage credential, you must create an external location that maps the credential to a specific S3 path. Then, you grant privileges on that external location to allow access. This is the standard Unity Catalog workflow for external data.

The other options describe incorrect or legacy methods.

Exam trap

The trap here is thinking that attaching IAM roles to instances or using secrets is sufficient, when Unity Catalog requires an external location object to bridge the credential and path.

216
Multi-Selecthard

A data engineer is setting up Lakehouse Federation to query an external MySQL database from Databricks. The engineer creates a connection using the MySQL connector and a foreign catalog. Users in the 'analysts' group report that they can see the foreign catalog but cannot query any tables. The engineer has granted USAGE on the connection to the 'analysts' group. Which TWO additional permissions must be granted to the 'analysts' group to allow them to query tables in the foreign catalog? (Choose two.)

Select 2 answers
A.BROWSE on the foreign catalog
B.CREATE on the foreign catalog
C.USE CATALOG on the foreign catalog
D.USE SCHEMA on the schemas containing the tables
E.SELECT on the foreign catalog
AnswersC, D

In Unity Catalog, to query objects within a catalog, a user must have USE CATALOG on that catalog. Even if the user has USAGE on the connection, without USE CATALOG on the foreign catalog, they cannot access any schemas or tables within it. This is a fundamental privilege for catalog-level access.

Why this answer

To query foreign tables in a foreign catalog, users need USE CATALOG on the foreign catalog and USE SCHEMA on the specific schemas. USAGE on the connection only allows the catalog to use the connection; it does not grant access to the catalog's objects. These two privileges are the minimum required for read access.

Exam trap

The trap here is assuming that USAGE on the connection is sufficient for querying foreign tables, overlooking the need for catalog and schema-level privileges.

217
MCQhard

Refer to the exhibit. A Databricks job fails with a 403 Forbidden error when trying to write to the S3 bucket. Why does this happen?

A.The Databricks cluster needs to be restarted to apply the new IAM policy.
B.The policy is missing the 's3:PutObject' action required for writing data.
C.The S3 bucket policy is blocking the request despite the IAM policy.
D.The 'Resource' ARN is missing the suffix '/*'.
AnswerB

The provided policy explicitly only allows 's3:GetObject'. To successfully write data to an S3 bucket, the IAM policy must include 's3:PutObject' as well. The 403 Forbidden error happens because the service principal lacks the authorization to perform the write operation defined in the Spark job code.

Why this answer

The provided IAM policy only grants 's3:GetObject' permissions, which is read-only. For a job to write data, it needs additional permissions like 's3:PutObject'. In production, strict adherence to the principle of least privilege is required; however, the policy must also enable the necessary write operations for the task to complete successfully.

The 403 error is a direct consequence of this missing write-specific capability in the policy definition.

Exam trap

Candidates often look past explicit IAM action definitions, assuming read-only permissions like 's3:GetObject' are sufficient for writing files if storage bucket access is broadly enabled.

218
MCQhard

A data engineer is designing a solution to share a Delta table with an external partner organization. The partner uses a different Databricks account and must be able to read the table, but the data must not be copied outside the provider's cloud storage. The provider uses Unity Catalog and wants to minimize operational overhead while ensuring the partner sees only the shared table. Which Unity Catalog feature should the engineer use?

A.A foreign table that points to the partner's storage location.
B.Grant SELECT on the table to the partner's service principal and configure cross-account IAM access.
C.Delta Sharing
D.A deep clone of the table into a storage location accessible by the partner.
AnswerC

Delta Sharing is a secure data sharing protocol that allows sharing data across organizations without copying it. The provider creates a share containing the table and grants the recipient access. The recipient reads the data using their own compute, and the data remains in the provider's storage. This minimizes operational overhead and meets the requirement of not copying data outside the provider's storage.

Why this answer

Delta Sharing is designed for cross-organization data sharing without copying data. The provider defines a share, adds the table, and grants the recipient access. The recipient can then read the shared data using their own Databricks workspace or other compatible clients.

The data stays in the provider's storage, and the provider retains control over access. This meets the requirements with minimal overhead.

Exam trap

The trap here is confusing Delta Sharing with cloning or foreign tables; only Delta Sharing allows reading data in place across accounts without copying.

219
MCQmedium

Which action allows a Data Engineer to receive a Slack notification when a Delta Live Tables pipeline finishes successfully?

A.Configure a SQL Alert to watch the system metadata tables.
B.Use the 'Notifications' setting in the DLT pipeline configuration.
C.Create a Python script that polls the Jobs API every minute.
D.Add a post-pipeline task that sends an email to the Slack email gateway.
AnswerB

DLT pipelines include a dedicated notifications section in the settings. By configuring a destination—such as a webhook URL—engineers can receive automated notifications for pipeline events, including successful completions or failures, ensuring seamless integration with communication tools like Slack or Microsoft Teams.

Why this answer

Databricks supports native notification channels that can be configured for pipelines. By adding a webhook for a specific Slack channel to the pipeline settings, engineers can receive real-time updates on pipeline lifecycle events, including completion. This integration is vital for workflow orchestration, allowing teams to trigger subsequent processes or notify stakeholders immediately without manual intervention, thereby streamlining the overall data platform efficiency.

Exam trap

Candidates mistakenly look for external workflow schedulers or custom Python scripts to trigger notifications, overlooking built-in notification configurations.

220
MCQhard

A data engineer is managing a Delta Share that includes a table with customer transactions. The share is used by multiple recipients. The engineer needs to update the shared data daily with new transactions and also remove data for customers who have requested deletion (right to be forgotten). The engineer wants to ensure recipients see the updated data without having to recreate the share. What is the best approach?

A.Use a materialized view to capture changes and share the view instead of the table.
B.Update the underlying Delta table with new data and use DELETE to remove records; recipients will see changes on their next query.
C.Use Delta Sharing's built-in history sharing to automatically propagate updates and deletions.
D.Recreate the share with the updated table and notify recipients to update their credentials.
AnswerB

Delta Sharing shares the live table. When the provider updates the Delta table (e.g., with MERGE or INSERT) and deletes records, recipients querying the shared table will see the latest version. There is no need to recreate the share. The recipients' queries will reflect the current state of the table, including deletions, as long as they query the latest version.

Why this answer

Delta Sharing shares the current state of the Delta table. When the provider performs updates or deletes on the table, recipients see the changes on their next query. There is no need to recreate the share or use materialized views.

This approach ensures recipients always access the latest data, including deletions for compliance.

Exam trap

The trap here is thinking that updates require recreating the share or that deletions are not visible, when in fact Delta Sharing reflects the live table state.

221
MCQmedium

A data engineer is debugging a slow-running query. They notice that the data is skewed, causing one task to take significantly longer than others. Which approach effectively addresses this skew?

A.Increase the cluster's disk size to allow for more local shuffle storage.
B.Add a salt column to the skewed key to distribute the data across more partitions.
C.Change the file format from Parquet to CSV to reduce overhead.
D.Enable 'Auto-scaling' to automatically add more nodes during the skewed stage.
AnswerB

Adding a salt to the join or grouping key forces Spark to distribute the data evenly across partitions. By breaking up the massive partition into smaller, manageable chunks, the workload becomes balanced, significantly reducing the execution time of the stage that was previously suffering from the data skew bottleneck.

Why this answer

Data skew occurs when one partition contains disproportionately more data than others, causing a single executor to bottleneck the entire stage. By using techniques like salt, broadcast joins, or repartitioning, the engineer can distribute the load more evenly across the cluster. This is essential for optimizing performance and preventing timeouts, ensuring that production jobs adhere to defined SLAs and utilize cluster resources efficiently.

Exam trap

Candidates often suggest simply increasing the cluster node count or core count, failing to realize that data skew leaves specific executors idle while one overloaded task bottlenecks the entire stage.

222
MCQmedium

A Data Engineer is developing a Delta Live Tables (DLT) pipeline using Python. They need to ensure that records failing a specific data quality check are dropped, but the pipeline continues to process the remaining valid records. Which expectation syntax should the engineer implement?

A.@dlt.expect_or_fail('col_check', 'id IS NOT NULL')
B.@dlt.expect('col_check', 'id IS NOT NULL')
C.@dlt.expect_or_drop('col_check', 'id IS NOT NULL')
D.@dlt.validate('col_check', 'id IS NOT NULL')
AnswerC

The expect_or_drop constraint removes records that fail the specified validation check while allowing the pipeline execution to continue. This pattern provides a balance between maintaining data quality standards and ensuring pipeline resilience, preventing transient bad data from blocking the ingestion of high-quality records into the target Delta tables.

Why this answer

The 'expect_or_drop' constraint is specifically designed for DLT to handle data quality failures gracefully. By using this expectation, the pipeline marks the record as invalid and removes it from the target dataset without halting the entire execution. This is critical in production environments where partial data ingestion is preferred over pipeline failure, ensuring high availability and robust data processing workflows for downstream users.

Exam trap

Candidates often confuse 'expect_or_fail' with 'expect_or_drop'. They mistakenly think the pipeline should stop when a bad record is found, rather than simply dropping the invalid record.

223
MCQmedium

When designing a streaming pipeline using Structured Streaming, which THREE of the following are necessary to ensure 'exactly-once' processing semantics in Databricks?

A.Using a source system that supports replaying data (e.g., Kafka or Delta).
B.Writing to the sink using an idempotent operation.
C.Setting 'spark.sql.shuffle.partitions' to 1.
D.Maintaining a checkpoint directory in a reliable storage location.
E.Disabling the Delta Lake write-ahead log.
AnswerA, B, D

Exactly-once requires the ability to re-read the stream from a specific offset if a failure occurs. Kafka and Delta provide the necessary offset management to ensure that data can be re-processed accurately after a system interruption, which is the foundational requirement for guaranteeing consistent results in streaming pipelines.

Why this answer

Exactly-once processing requires that the source system, the processing engine, and the sink system all support fault-tolerant checkpoints and idempotency. Databricks handles this through checkpointing and write-ahead logs. Understanding these components is critical for data engineers to ensure data consistency in critical financial or operational systems, preventing the common pitfalls of duplicate entries or missed data during cluster restarts or transient failures.

Exam trap

Candidates often focus only on the sink and ignore the source. They forget that 'exactly-once' is impossible if the source system cannot replay data during a failure recovery scenario.

224
MCQmedium

You are migrating a legacy CSV-based ETL process to Databricks. The source CSV files contain inconsistent date formats. Which approach provides the most scalable way to handle these inconsistencies during the bronze-to-silver transformation?

A.Convert all columns to string type to avoid parsing errors, and handle formatting in the visualization tool.
B.Use the 'from_unixtime' function with a hardcoded string format for all records.
C.Use the 'to_timestamp' function with an array of acceptable formats to parse the column.
D.Delete all rows with invalid date formats using a 'drop' expectation in a DLT pipeline.
AnswerC

The 'to_timestamp' function in Spark SQL accepts a format string or an array of formats. This allows the engine to attempt parsing against multiple patterns, which is the most robust and performant way to handle format inconsistencies without writing complex, slow-running row-based logic or custom UDFs.

Why this answer

Using Spark's `to_timestamp` with multiple format strings or a custom UDF is the standard, scalable way to handle format drift. By applying this logic in the Silver layer, you preserve the raw data in the Bronze layer while ensuring the refined data is standardized. This strategy follows the Medallion architecture pattern, allowing for lineage tracking and the ability to reprocess data if requirements change or better parsing logic is developed.

Exam trap

Candidates often attempt to fix inconsistent date formats using single-format parsers or raw string manipulation, ignoring functions that accept multiple fallback format patterns.

225
MCQmedium

Which of the following is the most secure method for a Data Engineer to provide access to a specific Delta table for a temporary project?

A.Granting ownership of the table to the user.
B.Adding the user to a temporary Unity Catalog group.
C.Sharing the credentials of a Service Principal.
D.Creating a copy of the table for the user.
AnswerB

Using a temporary group is a best-practice method for managing project-based access. When the project ends, the user is removed from the group, effectively revoking their access immediately. This approach is clean, transparent, and easy to audit, satisfying security requirements for managing temporary data access for external or internal collaborators.

Why this answer

Granting temporary access should be done using time-bound permissions or dedicated temporary groups. In Unity Catalog, the best approach is to manage access through a group and remove the user from that group when the project concludes. This ensures a clean, auditable, and repeatable process for managing temporary access requests, which is essential for maintaining a secure environment and avoiding the 'permission creep' that happens when users retain access indefinitely.

Exam trap

Candidates often suggest granting individual access or using long-lived service principals, which creates significant security debt. They overlook that Unity Catalog groups are the standard for scalable, auditable, and temporary access control.

Page 2

Page 3 of 4

Page 4

All pages