Courseiva

Databricks Certified Data Engineer Professional (Databricks-DE-Pro) — Questions 76–150

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

Page 1

Page 2 of 4

Page 3
76
MCQmedium

Refer to the exhibit. An administrator reviews the cluster configuration JSON for an all-purpose interactive development cluster used by data engineers. Based on Databricks cost and performance optimization best practices, which specific parameter in this configuration represents the highest risk for unnecessary financial expenditure?

A.The spark_version string specifies an ML runtime version containing unnecessary packages for general data engineering workloads.
B.The node_type_id specifies i3.xlarge storage-optimized instances which are entirely unsupported for running standard Delta Lake queries.
C.The auto_termination_minutes parameter is set to 120, allowing interactive compute to remain idle and bill at all-purpose rates for two full hours.
D.The autoscale max_workers limit is capped at 20, which will instantly crash any query exceeding ten gigabytes of data volume.
AnswerC

Idle interactive compute bills at the higher all-purpose DBU rate, so a 120-minute auto_termination window leaves two hours of chargeable inactivity per session. Shortening it to 10–30 minutes directly satisfies the stem's cost-optimisation constraint, since idle time, not cluster size, drives the unnecessary expenditure here.

Why this answer

The exhibit shows an all-purpose cluster configured with a 120-minute auto-termination timeout and heavy ML-runtime packages on storage-optimized instance types. Setting auto-termination to 120 minutes (2 hours) of inactivity causes extreme financial waste when developers walk away. Interactive all-purpose clusters should typically timeout after 30 to 60 minutes of inactivity to optimize cost recovery.

Exam trap

Candidates often focus on instance types or library versions. They fail to notice that an idle cluster running for two hours is a massive, avoidable cost leak in an interactive development environment.

77
MCQeasy

An engineer is building a Gold-layer star schema for a sales analytics workload. The business wants to analyze revenue by product, by store, and by promotion independently, and also drill down through a hierarchy of region to country to city. Which dimensional modeling structure best supports these requirements?

A.A fully normalized third-normal-form schema with separate tables for each attribute level
B.A star schema with conformed dimensions that include hierarchical attributes for drill-down
C.A snowflake schema that normalizes each hierarchy level into its own dimension table
D.A single wide denormalized table that embeds all dimensional attributes directly in the fact rows
AnswerB

A star schema places a central fact table joined to denormalized dimensions, and including hierarchical attributes such as region, country, and city within the geography dimension lets analysts drill down without extra joins. Conformed dimensions shared across facts like sales and promotions allow consistent analysis by product, store, and promotion independently while keeping queries simple.

Why this answer

Independent analysis by product, store, and promotion with hierarchical drill-down is the classic use case for a star schema built on conformed dimensions. Denormalized dimensions keep joins few, conformed dimensions keep definitions consistent across facts, and embedded hierarchy attributes like region, country, and city enable drill-down without additional tables.

Exam trap

The trap here is equating normalization with good modeling and choosing a snowflake or 3NF design, when the stated need for simple, consistent drill-down favors a star schema with conformed dimensions.

78
MCQmedium

A data engineer is ingesting streaming data from Apache Kafka into a Delta table using Databricks Structured Streaming. The engineer wants to ensure exactly-once processing and handle late-arriving data. Which combination of features should the engineer use?

A.Set the Kafka consumer group ID to a unique value and use foreachBatch to write to Delta.
B.Enable checkpointing and use watermarks with a time-based window.
C.Configure the Delta table with mergeSchema enabled and use append mode for writes.
D.Use the Kafka source with startingOffsets set to earliest and enable auto.offset.reset to latest.
AnswerB

Checkpointing ensures exactly-once processing by storing the offset and state information reliably, allowing recovery without reprocessing. Watermarks define how late data can arrive and still be processed, enabling the engine to drop overly late data and manage state. Together, they provide exactly-once semantics and handle late data in windowed aggregations, which is essential for reliable streaming ingestion from Kafka.

Why this answer

Exactly-once processing in Structured Streaming requires reliable checkpointing to track offsets and state. Watermarks are used to handle late-arriving data by defining a threshold beyond which data is dropped, and they enable state cleanup for windowed operations. Combining checkpointing with watermarks provides both exactly-once semantics and late data handling, making it the correct approach for ingesting Kafka data into Delta.

Exam trap

The trap here is thinking that consumer group settings or write modes alone can ensure exactly-once; checkpointing and watermarks are fundamental for stateful stream processing.

79
MCQhard

A data engineer maintains a Delta Lake table that stores 5 years of order data. Analysts frequently query the most recent 90 days, but compliance requires that older data remain queryable. The table is currently partitioned by order_date and has 200,000 small files because data arrives continuously via Structured Streaming. Queries on the last 90 days are slow and expensive. Which combination of actions will most effectively reduce query cost and improve performance for the recent-data queries?

A.Run OPTIMIZE with Z-ORDER BY order_date on the entire table and set delta.autoOptimize.optimizeWrite to true.
B.Enable Delta Lake column mapping and rewrite the table with generated columns for order month.
C.Run OPTIMIZE on the partitions covering the last 90 days to compact small files, and configure the streaming writer with a longer trigger interval and optimized writes to produce larger files.
D.Run OPTIMIZE on partitions covering the last 90 days, then use Z-ORDER BY order_date on those partitions, and enable optimized writes for the streaming ingestion.
AnswerC

Compacting the hot partitions reduces the number of files that queries must open, which directly lowers scan cost and improves performance for recent-data queries. Increasing the streaming trigger interval and enabling optimized writes reduces the rate of small-file creation going forward. This targets both the existing small-file problem and its root cause while leaving cold historical data untouched, which is the most cost-effective strategy.

Why this answer

The dominant problem is the 200,000 small files created by continuous streaming ingestion. Queries on the last 90 days must open many tiny files, which drives up overhead and cost. Compacting only the hot partitions with OPTIMIZE reduces file count where it matters most, and adjusting the streaming writer to produce larger files prevents the problem from recurring.

Z-ORDER on a partition key that is already the partition column adds little value, so focusing on compaction and ingestion file sizing is the correct optimization.

Exam trap

The trap here is reaching for Z-ORDER on the partition column, which is already used for partitioning and therefore provides minimal additional data-skipping benefit.

80
MCQmedium

A Databricks workspace has a Delta table 'transactions' partitioned by 'txn_date'. Analysts frequently run queries that filter on 'txn_date' but also occasionally filter on 'account_id' alone. The table has 10 TB of data, and the team wants to improve performance for the 'account_id' queries without changing the partitioning scheme. Which Delta feature should they implement?

A.Z-ORDER BY account_id
B.Partition the table by account_id as well as txn_date
C.Enable Delta Lake change data feed
D.Convert the table to a Hive table
AnswerA

Z-Ordering colocates related data in the same set of files, so queries filtering on account_id can skip many files. It is ideal when the table is already partitioned by txn_date and you need to optimize a secondary column without repartitioning. Running OPTIMIZE ... Z-ORDER BY account_id will reorganize data within each partition, improving data skipping for account_id filters.

Why this answer

Z-Ordering is the correct approach because it reorganizes data within existing partitions to improve data skipping for the specified columns without altering the partition structure. It is specifically designed to optimize queries on high-cardinality columns like account_id. Partitioning by account_id would cause scalability issues, CDF is for change tracking, and Hive tables lack Delta optimizations.

Exam trap

The trap here is assuming that adding another partition column will automatically improve filtering, when high-cardinality partitioning often causes small-file problems and slower queries.

81
MCQhard

A data engineer is using Delta Lake to manage a table that receives frequent updates and deletes. The engineer notices that query performance has degraded over time due to many small files. Which command should be used to optimize the table by compacting small files and improving query performance?

A.ANALYZE TABLE table_name COMPUTE STATISTICS
B.OPTIMIZE table_name
C.VACUUM table_name
D.ALTER TABLE table_name SET TBLPROPERTIES ('delta.autoOptimize.optimizeWrite' = 'true')
AnswerB

The OPTIMIZE command compacts small files into larger ones, reducing the number of files and improving query performance. It also supports Z-Ordering for multi-dimensional clustering. This is the standard Delta Lake operation for file compaction. It is efficient and can be scheduled regularly. This command directly addresses the issue of many small files.

Why this answer

The OPTIMIZE command is designed to compact small files into larger ones, improving read performance. It can also perform Z-Ordering to cluster data. VACUUM removes old files but does not compact, ANALYZE collects statistics, and autoOptimize.optimizeWrite prevents future small files but does not fix existing ones.

Therefore, OPTIMIZE is the correct command to address the current small file issue.

Exam trap

The trap here is confusing VACUUM with OPTIMIZE; VACUUM removes old files but does not compact small files, while OPTIMIZE specifically addresses file compaction.

82
MCQmedium

A retail company uses a Databricks Lakehouse with a star schema in the Gold layer. Their fact_sales table has billions of rows and is partitioned by sale_date. Analysts frequently run queries that filter on product_id and join to dim_product. Currently, queries scanning the entire fact table are slow. To improve performance for these queries, which approach is most appropriate?

A.Partition the fact_sales table by product_id.
B.Convert the fact_sales table to a Parquet table and use partition pruning.
C.Apply Z-ORDER BY product_id on the fact_sales table.
D.Add a bloom filter index on product_id.
AnswerC

Z-ORDER BY product_id co-locates related product_id values within each partition, enabling data skipping when filtering on product_id. This reduces the amount of data scanned during joins and filters, directly improving query performance for the described workload. It is a common optimization for high-cardinality columns used in filters and joins.

Why this answer

Z-ORDER BY product_id clusters data within each partition, allowing Delta Lake to skip files that do not contain the filtered product_id values. This reduces I/O and speeds up queries that filter or join on product_id. Partitioning by product_id is impractical due to high cardinality, and the other options do not provide the needed optimization.

Exam trap

The trap here is assuming that partitioning by a frequently filtered column is always beneficial, when high-cardinality columns should instead be optimized with Z-ORDER.

83
MCQeasy

A data engineer is using Databricks Repos to manage code for a production job. They need to ensure that the job always uses the latest version of the code from a specific branch. Which Git operation should they perform before running the job?

A.Merge the remote branch into the local branch using the Repos UI.
B.Pull the latest changes from the remote repository into the Repo.
C.Create a new branch from the current branch and switch to it.
D.Commit and push local changes to the remote repository.
AnswerB

Pulling updates the local Repo with the latest commits from the remote branch. This ensures the job runs the most recent code. In Databricks Repos, the pull operation is available via the UI or API and is a standard step before running jobs that depend on the latest code.

Why this answer

To ensure a Databricks job uses the latest code from a Git branch, the engineer must pull the latest changes into the Repo. This updates the working directory with the most recent commits. Committing, branching, or merging are not appropriate for simply retrieving updates.

Pulling is the standard Git operation for this purpose.

Exam trap

The trap here is confusing push with pull; pushing sends local changes to remote, while pulling retrieves remote changes to local.

84
MCQhard

A financial institution uses a Databricks Lakehouse with a Silver table transactions that is partitioned by transaction_date. The table is frequently queried with filters on transaction_date and account_id. The data engineering team notices that queries filtering on account_id are slow because they scan all partitions. They want to optimize the table to accelerate these queries without repartitioning. Which Delta Lake feature should they use?

A.Partition the table by account_id as well.
B.Convert the table to a Parquet table and use predicate pushdown.
C.Z-ORDER BY account_id
D.Enable change data feed on the table.
AnswerC

Z-ORDER BY account_id will co-locate similar account_id values within each partition, enabling data skipping for filters on account_id. Since the table is already partitioned by transaction_date, this adds efficient skipping for account_id without changing the partitioning scheme. This directly addresses the slow queries filtering on account_id.

Why this answer

Z-ORDER BY account_id clusters data within each partition by account_id, allowing Delta Lake to skip files that do not contain the filtered account_id values. This accelerates queries filtering on account_id without altering the existing partitioning by transaction_date. Other options either do not improve performance or introduce negative side effects.

Exam trap

The trap here is thinking that adding another partition column will solve the problem, but high-cardinality columns are better handled with Z-ORDER to avoid the small file problem.

85
Multi-Selectmedium

Which THREE techniques are recommended for improving the performance of Spark SQL joins on large Databricks tables?

Select 3 answers
A.Broadcast the smaller table in a join to avoid shuffling large datasets.
B.Increase the number of partitions to the maximum possible value to ensure maximum parallelism.
C.Bucket the tables on the join key to enable sort-merge joins without shuffling.
D.Use Cross Join for every join operation to ensure no data rows are missed.
E.Filter data as early as possible in the pipeline before performing the join.
AnswersA, C, E

Broadcasting sends a copy of the smaller table to every worker node, allowing the join to be performed locally without shuffling the larger table. This eliminates the expensive network I/O associated with data shuffling, which is the most common cause of performance degradation in large-scale distributed join operations.

Why this answer

Optimizing joins is critical to performance as they are often the most resource-intensive operations in Spark. Techniques like broadcasting small tables, using bucketing to avoid shuffles, and ensuring data is properly partitioned help the Spark engine execute joins efficiently. By minimizing the amount of data moved across the network (shuffling) and maximizing local processing, jobs complete faster and consume fewer compute resources, leading to a more performant and cost-effective overall data architecture.

Exam trap

Candidates often confuse shuffle reduction techniques, choosing generic caching or increasing partition counts without realizing that broadcasting small tables and bucketing are the direct structural methods to eliminate shuffle overhead during joins.

86
MCQmedium

You are writing a Spark application that uses a Broadcast Hash Join. You want to force the join to use broadcast optimization for a specific table. How do you implement this in PySpark?

A.df1.join(broadcast(df2), 'key')
B.df1.join(df2, 'key', 'broadcast')
C.spark.conf.set('spark.sql.broadcastJoin', 'true')
D.df1.join(hint('broadcast'), df2, 'key')
AnswerA

The broadcast function wrapper forces the Spark optimizer to broadcast the smaller DataFrame (df2) to all nodes in the cluster. This avoids shuffling the larger table, which is a major performance boost for joins where one side is small enough to fit in the executor memory.

Why this answer

Using the 'broadcast()' function in PySpark explicitly hints to the Spark optimizer that a specific DataFrame should be broadcasted to all executors. This is highly effective when joining a large fact table with a small dimension table, as it avoids the expensive shuffle operation. Understanding this is crucial for performance tuning, as relying solely on the automatic broadcast threshold may lead to suboptimal join choices in complex queries.

Exam trap

Test-takers incorrectly try to use SQL hints or DataFrame configuration properties instead of the required PySpark functional wrapper to force a broadcast join.

87
MCQeasy

Which of the following is the best practice for managing alerts for a mission-critical production pipeline?

A.Configure alerts to send emails to individual developers.
B.Use a central notification channel connected to an incident management tool.
C.Create a dashboard and check it manually every hour.
D.Disable alerts for development environments.
AnswerB

Integrating alerts with incident management systems (like PagerDuty or Opsgenie) ensures that failures are tracked, acknowledged, and escalated appropriately. This provides a professional, scalable approach to observability that guarantees reliable incident resolution and team accountability.

Why this answer

Centralizing alerts within Databricks and routing them to a dedicated incident management tool ensures that issues are tracked, assigned, and resolved systematically. Avoiding fragmented notification methods is key to operational maturity. This approach prevents alert fatigue, ensures that the correct personnel are notified during off-hours, and keeps a clear historical record of system issues for post-mortem analysis and continuous improvement of the data architecture.

Exam trap

Candidates often choose fragmented methods like individual user emails or custom scripts instead of leveraging a centralized incident management tool to avoid alert fatigue.

88
MCQmedium

A retail company is designing a Gold-layer dimension table in Delta Lake for its product catalog. The catalog changes slowly: a product's category is occasionally reclassified, but historical sales fact rows must continue to reflect the category that was valid at the time of each sale. The team wants to avoid duplicating the entire product row for every change. Which Delta Lake modeling technique should the engineer implement?

A.A junk dimension that collapses category combinations into a separate table keyed by a surrogate
B.Type 1 slowly changing dimension implemented with MERGE INTO that overwrites the category column in place
C.A Type 3 dimension that adds a previous_category column to the existing product row
D.Type 2 slowly changing dimension with effective-date and current-flag columns populated via MERGE INTO
AnswerD

A Type 2 dimension inserts a new versioned row whenever the category changes and closes the prior row with an end date, preserving history. Fact rows can then join on the surrogate key or on the effective-date range valid at the transaction timestamp, so each sale continues to show the correct historical category without duplicating the whole catalog for unchanged attributes.

Why this answer

Preserving point-in-time accuracy for a slowly changing attribute requires versioned dimension rows with validity ranges and a current flag, which is the defining behavior of a Type 2 slowly changing dimension. A MERGE INTO statement can close the existing row and insert a new one atomically, letting fact rows resolve the correct historical category through an effective-date join or surrogate key.

Exam trap

The trap here is assuming that overwriting the category in place is acceptable because the requirement only mentions the current catalog view, when the point-in-time accuracy clause specifically demands versioned history.

89
Multi-Selecthard

A data engineer is troubleshooting a Databricks Workflow where a downstream task relies on an upstream task's output. Which TWO actions ensure the data dependency is correctly handled during a failure scenario?

Select 2 answers
A.Configure the downstream task to use the 'depends_on' attribute to reference the upstream task ID.
B.Set the task timeout to zero to prevent the workflow from ever stopping during a failure.
C.Enable the 'repair and rerun' feature to target only the failed tasks in the pipeline.
D.Hardcode the file path of the upstream output into the downstream task configuration.
E.Disable all retries to ensure that the error log is captured immediately upon failure.
AnswersA, C

The 'depends_on' attribute explicitly defines the task DAG structure within Databricks Workflows. By creating this dependency, the scheduler guarantees that the downstream task will only execute if the upstream task succeeds, preventing erroneous runs when input data is missing or corrupted due to preceding failures.

Why this answer

Proper dependency management ensures that downstream tasks do not attempt to process incomplete or missing data from upstream failures. By using task dependencies and repair-and-rerun capabilities, engineers can isolate failures and maintain data integrity. These features are critical in production pipelines to prevent downstream corruption and ensure that data lineage remains consistent throughout the workflow execution cycle regardless of individual component failures.

Exam trap

Candidates often confuse workflow task configuration attributes like 'depends_on' with general cluster settings, or forget that 'repair and rerun' requires specific task targeting instead of restarting the entire pipeline from scratch.

90
MCQhard

An engineer needs to optimize a massive table that is frequently joined with other large tables. Which strategy is most effective for performance?

A.Increase the number of partitions to spread the data across more nodes.
B.Apply Z-Ordering to the join keys.
C.Cast all join keys to strings to ensure data type compatibility.
D.Use a broadcast join for all large-table join operations.
AnswerB

Z-Ordering on join keys physically co-locates related data, which is essential for join efficiency. This reduces the need for extensive shuffling during join operations, as the compute engine can perform more efficient local joins. This is a critical optimization for large-scale analytical tables within the Lakehouse architecture.

Why this answer

For large-scale joins, the most effective strategy is to Z-Order the join keys. This ensures that records with the same join keys are physically stored together, allowing the Databricks engine to use merge joins rather than costly shuffle-heavy hash joins. By minimizing data movement across the cluster during the shuffle phase, Z-Ordering on join keys significantly reduces execution time and resource consumption for complex, large-scale join operations.

Exam trap

Candidates often suggest partitioning by the join key, failing to realize that high-cardinality join keys result in millions of small files, which severely degrades cluster performance.

91
MCQmedium

A data scientist reports that their notebook takes 20 minutes to initialize, even when the cluster is running. What is the most likely reason for this high initialization time?

A.The cluster is using spot instances.
B.The notebook is installing many libraries using %pip install.
C.The cluster has too many workers allocated.
D.The user is using the wrong Databricks Runtime version.
AnswerB

Notebook-scoped library installations trigger a package resolution and installation process every time the Spark context starts or resets. For large sets of dependencies, this can take a long time. Moving these to cluster-level libraries ensures they are pre-installed on every node, which drastically reduces the notebook's initialization time.

Why this answer

High initialization time in a running cluster is frequently caused by excessive libraries being installed at the notebook level via '%pip install'. Every time the notebook is attached or the context is refreshed, these libraries must be re-resolved and installed, which adds significant overhead. Pre-installing these libraries at the cluster level via 'cluster-scoped libraries' allows them to be available immediately upon startup, eliminating this redundant installation phase and significantly speeding up the initialization process.

Exam trap

Candidates often blame cluster startup times or network latency, forgetting that executing '%pip install' dynamically inside a notebook triggers redundant library resolution and installation loops.

92
MCQmedium

A data engineer is reviewing the event log of a Databricks job that has just failed. They need to determine the exact cause of the failure. Which event type in the event log indicates that a task failed due to an exception?

A.RUN_FAILED
B.TASK_FAILED
C.JOB_FAILED
D.EXECUTION_FAILED
AnswerB

TASK_FAILED is the event type logged when a task within a job run fails due to an exception or error. It includes details such as the error message and stack trace, which are essential for diagnosing the root cause. This event is the most direct indicator of a task-level failure in the event log.

Why this answer

The TASK_FAILED event is logged when an individual task within a job run encounters an exception. It captures the error message, stack trace, and other relevant metadata, making it the primary source for diagnosing task-level failures. Other event types like JOB_FAILED indicate a higher-level failure but lack the specific task exception details.

Therefore, TASK_FAILED is the correct choice for determining the exact cause of a task failure.

Exam trap

The trap here is confusing JOB_FAILED with TASK_FAILED, assuming that a job failure event contains the specific task exception details.

93
MCQmedium

You are optimizing a PySpark job that reads from a Delta table. You notice skewed data distribution on the 'customer_id' column, causing Task-level stragglers. Which transformation should you apply to the DataFrame to mitigate this skew during a join operation?

A.Increase the spark.sql.shuffle.partitions configuration dynamically.
B.Broadcast the skewed table to all executors.
C.Salt the skewed column and perform the join.
D.Cache the skewed table in memory before the join.
AnswerC

Salting distributes the rows associated with the skewed key across multiple partitions by appending a random integer. This forces the join operation to process these rows in parallel across different executors, effectively eliminating the bottleneck caused by the skewed distribution of the customer_id column during the shuffle phase.

Why this answer

Salting involves adding a random prefix to the join key of the skewed table and exploding the join key of the dimension table. This technique breaks down massive partitions caused by skewed keys into smaller, evenly distributed chunks. Understanding data skew is critical in Databricks for maintaining cluster stability and preventing OOM errors, ensuring that shuffle partitions are utilized efficiently across all available executors rather than overloading one core.

Exam trap

Candidates often confuse salting with partitioning. They mistakenly attempt to repartition the DataFrame using the skewed key itself, which does not address the uneven distribution of records across partitions during the shuffle phase.

94
MCQmedium

Which design pattern is best suited for handling late-arriving data in a medallion architecture?

A.Discard all late-arriving records to ensure a clean source-of-truth.
B.Update the Silver layer using a MERGE operation that matches on event time.
C.Append late-arriving data to the Bronze layer but ignore it in all downstream layers.
D.Create a separate 'late_data' table and join it to the main table every month.
AnswerB

The MERGE operation is ideal for late-arriving data because it can identify existing records and update them with the corrected information. By using event time as a matching key, the pipeline can ensure that even if data arrives out of order, the state of the Silver table remains accurate.

Why this answer

Late-arriving data is common in streaming and batch pipelines. Using a watermarking strategy combined with a merge or upsert operation allows the system to process incoming data while maintaining the integrity of historical windows. By allowing late records to update existing states, the system remains accurate despite delays from the source, which is critical for time-sensitive financial or operational reporting where accuracy is paramount.

Exam trap

Candidates often suggest using append-only strategies or creating separate tables for late data, which complicates downstream consumption and breaks the integrity of historical reporting.

95
MCQhard

A data engineer is troubleshooting a Databricks job that fails with a `SparkException: Job aborted due to stage failure` and the error log shows `java.lang.OutOfMemoryError: GC overhead limit exceeded` on an executor. The job processes a large dataset using a `groupByKey` operation. Which action should the engineer take to resolve the issue while minimizing changes to the existing code?

A.Increase the executor memory by adding `spark.executor.memory=16g` to the cluster Spark configuration.
B.Set `spark.sql.shuffle.partitions` to a higher value to increase the number of partitions after shuffle.
C.Replace `groupByKey` with `reduceByKey` to reduce memory pressure by combining values locally before shuffling.
D.Switch the job to use a larger cluster with more worker nodes to distribute the load.
AnswerC

`groupByKey` shuffles all values for a key without local aggregation, which can cause excessive memory usage and GC overhead. `reduceByKey` performs map-side combining, reducing the amount of data shuffled and lowering memory pressure. This change directly addresses the root cause while requiring minimal code modification, as both are transformations on key-value pairs. It is the most effective fix for the described symptom.

Why this answer

The `groupByKey` operation shuffles all values for each key without local aggregation, which can lead to excessive memory consumption and GC overhead. Replacing it with `reduceByKey` enables map-side combining, significantly reducing the shuffle size and memory footprint. This is the most direct and code-minimal fix.

Other options either mask the symptom or do not address the root cause.

Exam trap

The trap here is thinking that adding more memory or nodes will solve an OOM caused by an inefficient shuffle operation like `groupByKey`.

96
MCQeasy

A data engineer needs to grant a service principal permission to read data from a Unity Catalog table named sales.orders. The service principal is used by an automated job and should have only the minimum necessary privileges. Which Unity Catalog privilege should be granted on the table to allow the service principal to read data?

A.ALL PRIVILEGES
B.SELECT
C.USAGE
D.MODIFY
AnswerB

SELECT is the privilege that allows reading data from a table in Unity Catalog. Granting SELECT on sales.orders to the service principal gives it the ability to query the table, which is the minimum required for read access. This follows the principle of least privilege and does not grant unnecessary capabilities such as modifying data or changing metadata.

Why this answer

In Unity Catalog, SELECT is the privilege that grants read access to a table. For a service principal that only needs to read data, granting SELECT on the specific table is the least-privilege approach. Other privileges like MODIFY or ALL PRIVILEGES would provide additional capabilities that are not required and could increase risk.

Exam trap

The trap here is confusing USAGE with read access; USAGE on a table does not allow reading data, and MODIFY is for writes, not reads.

97
MCQeasy

A data engineer is configuring a Databricks workspace with Unity Catalog. The security team wants to ensure that all data access is logged for compliance auditing. The engineer enables audit logs and configures delivery to a cloud storage location. Which Unity Catalog object should the engineer use to query audit logs for data access events?

A.The system table 'system.access.audit' in Unity Catalog.
B.The 'event_log' table in the workspace's Hive metastore.
C.The 'audit_logs' Delta table in the 'default' database.
D.The 'information_schema.audit_logs' view in Unity Catalog.
AnswerA

Unity Catalog provides system tables that contain audit logs. The 'system.access.audit' table records all access events, including data access, and can be queried directly in Databricks SQL or a notebook. This table is part of the system schema and is automatically populated when audit logging is enabled. It is the correct object for querying audit logs within Unity Catalog.

Why this answer

Unity Catalog system tables include 'system.access.audit', which records audit events such as data access. This table is automatically populated and can be queried for compliance. Other options refer to non-existent or unrelated objects.

The system table is the correct and standard way to access audit logs within Unity Catalog.

Exam trap

The trap here is confusing cluster event logs or metadata views with Unity Catalog audit logs, which are specifically stored in system tables.

98
MCQeasy

A data engineer notices that a Databricks SQL warehouse used for executive dashboards runs 24/7 but is only actively queried during business hours. The warehouse is a Pro-sized warehouse with auto-stop set to 10 minutes. The team wants to reduce cost without affecting dashboard availability during business hours. Which action should the data engineer take?

A.Enable serverless compute for the warehouse and set the auto-stop to 1 minute.
B.Create a schedule to stop the warehouse outside business hours and start it before the business day begins.
C.Add a second warehouse for the executive dashboards and route queries to it only during business hours.
D.Change the warehouse to a Classic-sized warehouse and increase the auto-stop to 30 minutes.
AnswerB

A scheduled stop/start targets the root cause: the warehouse is idle but running outside business hours. Stopping it overnight and on weekends eliminates compute charges during those periods, while starting it before business hours ensures dashboards are available when needed. This is the most direct and effective cost reduction for a predictable usage pattern.

Why this answer

The warehouse is billed for the time it is running, so the largest saving comes from eliminating the predictable idle window outside business hours. Scheduling a stop at the end of the day and a start before business hours ensures the warehouse is available when dashboards are used and incurs no compute cost overnight and on weekends. Auto-stop alone does not help if the warehouse is kept running or restarted by sporadic queries, and resizing or adding warehouses does not target the idle period.

Exam trap

The trap here is focusing on auto-stop or warehouse size, which only affect the period after the last query, instead of scheduling the warehouse to be off during the known idle window.

99
MCQmedium

A logistics company wants to analyze shipment delays. The fact table `fact_shipments` has a `delay_minutes` measure. The team needs to slice delays by the reason for delay, which can be one of several predefined categories. Which dimension modeling approach is most suitable?

A.Create a dimension table `dim_delay_reason` with a surrogate key and reference it from the fact table.
B.Create a snowflake schema by normalizing delay reasons into multiple tables.
C.Use a junk dimension to combine delay reason with other low-cardinality attributes.
D.Store the delay reason as a string column directly in the fact table.
AnswerA

A dedicated dimension table for delay reasons allows efficient slicing and grouping. It ensures consistency and supports adding new reasons without altering the fact table. This is a standard star schema approach. In Databricks, it can be joined efficiently and optimized with Z-ORDER.

Why this answer

A dedicated dimension table for delay reasons provides a clean, efficient way to slice shipment delays. It supports consistent categorization and easy addition of new reasons. Storing as a string in the fact table or snowflaking adds performance and maintenance overhead.

A junk dimension would obscure the ability to analyze by delay reason alone.

Exam trap

The trap here is thinking that storing the reason as a string in the fact table is simpler and sufficient, but it leads to poor query performance and data quality issues.

100
MCQmedium

A team is building a streaming pipeline that processes millions of events per second. They are using Structured Streaming with a Delta Lake sink. What is the most effective way to optimize the performance and cost of this write-heavy workload?

A.Increase the trigger interval to 1 hour to batch writes.
B.Disable checkpointing to reduce the write latency.
C.Force a global sort before writing to the Delta table.
D.Enable 'delta.autoOptimize.optimizeWrite' and 'delta.autoCompact'.
AnswerD

These features automatically manage file sizes during writes and consolidate them after writes. This eliminates the small file problem inherent in streaming workloads, ensuring that the cloud storage layer remains efficient. This is the industry-standard approach for maintaining Delta Lake performance and keeping storage costs optimized for streaming.

Why this answer

For high-volume streaming, the 'optimizeWrite' and 'autoCompact' features are critical. 'optimizeWrite' ensures that data is written in optimal file sizes (typically 128MB) before committing, which prevents the creation of small files in the cloud storage. This reduces the burden on the file system and improves downstream read performance. Combined with 'autoCompact', the table remains performant for analytical queries without manual intervention, saving compute cycles and maintenance time.

Exam trap

Candidates often choose manual 'OPTIMIZE' commands or manual file management instead of leveraging built-in Delta features, failing to realize that streaming pipelines require automated, continuous file maintenance to prevent significant performance degradation.

101
MCQmedium

Which of the following describes the behavior of the 'OPTIMIZE' command in Databricks?

A.It recomputes statistics to improve query planning.
B.It rewrites data files into a more efficient layout for reads.
C.It clears the transaction log to reduce storage costs.
D.It converts non-Delta tables to Delta format.
AnswerB

OPTIMIZE rewrites the underlying Parquet files to be more efficiently sized, addressing the 'small file problem.' By compacting many small files into larger ones, it reduces the I/O overhead for readers and optimizes the file layout, which is essential for maintaining query performance in Delta tables.

Why this answer

The 'OPTIMIZE' command performs file compaction, which consolidates small files into larger, optimally sized files. This improves scan performance significantly by reducing the metadata overhead of opening and reading many tiny files. It also supports Z-Ordering, which co-locates related data in the same files, further enhancing the efficiency of data skipping and improving query speed for common filter predicates.

Exam trap

Examinees frequently confuse 'OPTIMIZE' with data cleaning or deduplication operations, ignoring its exact function of file compaction and layout improvement.

102
MCQhard

A data engineer is deploying a Databricks job that uses a Python wheel task. The job fails with the error: 'ModuleNotFoundError: No module named 'my_library''. The wheel file is stored in DBFS at 'dbfs:/FileStore/wheels/my_library-0.1.0-py3-none-any.whl'. The job cluster is configured with a cluster policy that restricts library installation from DBFS. What is the most likely cause of the failure?

A.The job cluster does not have the 'pip' package manager installed.
B.The wheel file path is incorrect; it should be 'dbfs:/FileStore/wheels/my_library-0.1.0-py3-none-any.whl' without the 'dbfs:/' prefix.
C.The cluster policy prevents installing libraries from DBFS, so the wheel was not installed.
D.The wheel file is not compatible with the cluster's Python version.
AnswerC

Cluster policies can restrict library sources. If the policy disallows DBFS libraries, the wheel will not be installed, leading to the ModuleNotFoundError. This is the most likely cause because the error explicitly states the module is missing, and the policy restriction directly prevents installation. The engineer should either adjust the policy to allow DBFS or move the wheel to a supported location like Unity Catalog volumes or cloud storage.

Why this answer

The error indicates that the Python module 'my_library' is not available in the job cluster's environment. Since the wheel is stored in DBFS and the cluster policy restricts library installation from DBFS, the wheel was not installed. The engineer must either modify the cluster policy to allow DBFS libraries or relocate the wheel to a permitted source, such as a Unity Catalog volume or cloud storage, and then install it.

Exam trap

The trap here is focusing on the wheel's compatibility or path syntax instead of the cluster policy restriction that blocks installation from DBFS.

103
MCQeasy

In the medallion architecture, which layer is primarily responsible for applying business logic and historical aggregations?

A.The Bronze layer acts as the primary layer for historical aggregation and business logic.
B.The Silver layer is designed for applying complex business logic and final aggregations.
C.The Gold layer is designed for applying business logic and historical aggregations.
D.The Raw layer stores all business logic results for future auditing.
AnswerC

Gold is the analytical layer. It transforms Silver data into business-ready aggregates, KPIs, and reports. By focusing on business logic here, the engineering team ensures that the data is prepared specifically for downstream consumption, reducing the computational load on end-user tools while ensuring consistent metrics across the organization.

Why this answer

The Gold layer is the final stage of the medallion architecture, where data is prepared for consumption by BI tools and data science applications. It involves cleaning, transforming, and aggregating data according to business rules. This layer represents the 'source of truth' for analytical reporting, as it is structured to support specific business use cases rather than representing the raw or cleaned granular data found in earlier layers.

Exam trap

Test-takers frequently confuse the Silver layer with the Gold layer, incorrectly assuming historical aggregations and business-level logic happen before data cleansing and integration are fully complete.

104
MCQmedium

A data engineer is designing a Gold layer table for a retail company. The table must support efficient queries that filter on product_category (low cardinality) and sort by transaction_timestamp (high cardinality). The table is expected to grow to petabytes. Which Delta Lake table design should the engineer choose to optimize both filtering and sorting?

A.Z-ORDER BY both product_category and transaction_timestamp.
B.Partition by product_category only, without Z-ORDER.
C.Partition by product_category and Z-ORDER BY transaction_timestamp.
D.Partition by transaction_timestamp and Z-ORDER BY product_category.
AnswerC

Partitioning by product_category, which has low cardinality, avoids the small file problem and enables partition pruning for filters on that column. Z-ORDER BY transaction_timestamp clusters data within each partition to accelerate sorting and range queries on that column. This combination optimally supports both filtering and sorting.

Why this answer

Partitioning by the low-cardinality product_category enables efficient partition pruning for filters. Z-ORDER BY the high-cardinality transaction_timestamp clusters data within partitions, speeding up sorting and range queries on that column. This combined approach leverages both partitioning and Z-ORDER appropriately, avoiding the pitfalls of partitioning on high-cardinality columns.

Exam trap

The trap here is partitioning by a high-cardinality column like transaction_timestamp, which leads to many small partitions and poor performance.

105
MCQhard

You are developing a Delta Live Tables (DLT) pipeline and need to ensure high data quality. Which TWO of the following statements correctly describe how Expectations work within DLT?

A.Expectations only support dropping rows that fail validation.
B.You can use 'expect_or_fail' to stop the pipeline if a constraint is violated.
C.Expectations can be defined as Python decorators or SQL constraints.
D.Expectations must be configured in the pipeline settings JSON file.
E.Expectations automatically fix invalid data values.
AnswerB, C

The 'expect_or_fail' operator is specifically designed for mission-critical data. If a single row violates the defined expectation, the pipeline execution is halted immediately. This ensures that no downstream transformations are processed with potentially tainted data, maintaining strict integrity requirements for sensitive analytical or operational datasets.

Why this answer

Expectations are a fundamental feature in Delta Live Tables that allow engineers to define data quality constraints directly within the DLT pipeline code. By specifying these rules, developers can monitor data health, quarantine corrupt rows, or fail pipelines when critical thresholds are breached. This declarative approach integrates governance into the data engineering workflow, ensuring that downstream consumers receive only validated, high-quality data while maintaining robust audit trails for compliance.

Exam trap

Candidates often assume DLT expectations can only be written in Python or that violations automatically drop tables, missing the flexibility of SQL and 'expect_or_fail'.

106
Multi-Selecthard

Which THREE strategies should a data engineer use to optimize the debugging of failed production Databricks Jobs?

Select 3 answers
A.Implement structured logging within the application code to track variable states.
B.Grant all developers full cluster permissions to access logs directly on the nodes.
C.Modularize code into libraries (wheels) to enable easier unit testing and local debugging.
D.Configure alerts on job failures to send notifications to a team Slack or email channel.
E.Run all production jobs as the root user to avoid permission-related errors.
AnswersA, C, D

Structured logging provides granular insight into the execution path and variable values, which are otherwise unavailable once a job fails. By writing these logs to a persistent sink, engineers can reconstruct the state of the application at the exact moment of failure, significantly reducing the time required for investigation.

Why this answer

Efficient debugging relies on observability, modular design, and access control. By leveraging logs, modularizing code, and ensuring proper access, engineers can quickly isolate root causes. These strategies are essential for minimizing Mean Time to Recovery (MTTR) in production.

Proactive monitoring and well-structured codebases allow for faster identification of failures, ensuring that business-critical pipelines remain operational and that the team can respond to incidents with precision and speed.

Exam trap

Candidates often suggest manually inspecting cloud provider logs (like CloudWatch) first. They overlook that Databricks Jobs UI and Git integration provide the specific context needed for application-level failures.

107
MCQmedium

An organization wants to restrict data access to only allow connections from specific corporate IP ranges. Which Databricks feature should be configured to implement this network security requirement?

A.Unity Catalog access controls.
B.IP Access Lists.
C.Cluster-level Spark configurations.
D.Workspace-level SSO integration.
AnswerB

IP Access Lists are the specific Databricks feature designed to restrict access based on source IP. By defining a set of allowed CIDR ranges, administrators can ensure that users can only interact with the Databricks environment from authorized network locations, satisfying critical security and compliance requirements for enterprise clients.

Why this answer

Network-level security is a cornerstone of enterprise data governance. By using IP access lists, Databricks allows administrators to define a whitelist of allowed CIDR blocks. This ensures that even if a user has valid credentials, they cannot access the Databricks workspace unless they are connecting from a trusted corporate network, effectively mitigating the risk of unauthorized access from public or malicious locations.

Exam trap

Candidates often confuse 'IP Access Lists' with 'Unity Catalog permissions' or 'Workspace Entitlements.' They fail to realize that network-level traffic filtering happens before authentication.

108
MCQhard

A financial services firm stores market data in an external location registered in Unity Catalog as `s3://firm-market-data/`. The security team requires that only a specific IAM role, assumed by a Unity Catalog storage credential, can read the bucket, and that no Databricks user can bypass Unity Catalog to read the data directly with their own cloud credentials. The Data Engineer must configure the storage credential. Which configuration achieves this?

A.Create a storage credential using an access key and secret key with full S3 permissions, and attach it to the external location.
B.Create a storage credential that assumes an IAM role whose trust policy allows only the Unity Catalog metastore's IAM role, and grant the credential to the external location.
C.Create a storage credential backed by an instance profile attached to the cluster's EC2 instances, and grant it to the external location.
D.Create a storage credential that assumes an IAM role trusted by every Databricks workspace in the account, and grant it to the external location.
AnswerB

This is the supported pattern: the storage credential assumes a customer IAM role, and the role's trust policy permits only the Unity Catalog metastore's IAM role to assume it. Because the bucket policy or role permissions allow access only through that path, users cannot read the bucket with their own credentials, and Unity Catalog mediates all access. Granting the credential to the external location completes the wiring.

Why this answer

The secure pattern is a storage credential that assumes a customer IAM role whose trust policy names only the Unity Catalog metastore's IAM role. That makes the metastore the sole path to the bucket, so users cannot use their own credentials to read it, and Unity Catalog enforces privileges at query time. Static keys, broad workspace trust, and instance profiles all create alternate access paths or long-lived secrets.

Exam trap

The trap here is assuming that any storage credential that can read the bucket is sufficient, when the trust policy must specifically restrict assumption to the Unity Catalog metastore's IAM role to prevent bypass.

109
Multi-Selectmedium

Which TWO of the following are benefits of using Unity Catalog for managing data governance in a multi-workspace environment?

Select 2 answers
A.Workspaces can have independent, non-overlapping governance.
B.Centralized access control across all workspaces.
C.Unified audit trail for all data activities.
D.Increased performance for all SQL queries.
E.Automatic data encryption at the application level.
AnswersB, C

Unity Catalog provides a centralized point to manage access control. Instead of configuring permissions in every workspace, an admin can grant access in Unity Catalog, and those permissions are honored across every workspace connected to the metastore. This significantly reduces administrative overhead and ensures a uniform security policy everywhere.

Why this answer

Unity Catalog provides a unified, centralized governance layer that spans all workspaces in a Databricks account. This eliminates the need for siloed management, ensuring that users have consistent access rights, audit trails, and data discovery across the entire organization. By streamlining these processes, Unity Catalog simplifies compliance and improves collaboration while maintaining strict control over who can access which data objects across the enterprise.

Exam trap

Candidates often think Unity Catalog is only for 'data discovery' or 'metadata storage,' overlooking its primary enterprise value: unified security and auditing across multiple independent workspaces.

110
MCQhard

You need to perform a deduplication task on a streaming source that includes late-arriving data. Which Delta Lake feature is best suited to manage this while ensuring efficient state cleanup?

A.Use a standard SQL DELETE query with a subquery to identify and remove duplicates.
B.Use the dropDuplicates() method with watermark settings to manage state.
C.Set the table property 'delta.enableChangeDataFeed' to true and filter on the change log.
D.Increase the 'spark.sql.shuffle.partitions' setting to ensure all duplicates land on the same node.
AnswerB

Using dropDuplicates on a streaming DataFrame, combined with a watermark, allows Spark to manage the state of seen records efficiently. The watermark specifies the time limit for which duplicates are tracked, ensuring the state doesn't grow indefinitely, which is essential for long-running streaming pipelines consuming data with late arrivals.

Why this answer

The `withWatermark` and `dropDuplicates` combination is specifically designed for streaming deduplication. Watermarks tell the engine how long to wait for late-arriving data, allowing it to clear old state from memory. This is critical for high-volume streaming jobs where state growth would otherwise lead to out-of-memory errors or significant performance degradation, ensuring the job remains stable over long periods of execution.

Exam trap

Candidates often select simple batch deduplication methods or manual window operations, failing to recognize that watermarking is essential for managing state and late-arriving data in streaming.

111
MCQhard

A data engineer is configuring a Unity Catalog storage credential to access an AWS S3 bucket. The organization's security policy requires that Databricks assumes an IAM role, and that no long-lived AWS access keys are stored in Databricks. The engineer has created an IAM role with a trust policy and an external ID. Which action must the engineer take to complete the storage credential configuration in Unity Catalog?

A.Specify the IAM role ARN and the external ID in the storage credential, and ensure the role's trust policy allows the Databricks AWS account to assume it.
B.Provide the AWS access key ID and secret access key of an IAM user that has permissions to the S3 bucket.
C.Attach an instance profile to the cluster and grant the cluster's IAM role access to the S3 bucket, then create the storage credential without an IAM role.
D.Configure a service principal in Databricks, assign it the S3 bucket policy, and use its client ID and secret as the storage credential.
AnswerA

Unity Catalog storage credentials for S3 use an IAM role that Databricks assumes. The credential stores the role ARN, and the trust policy must allow the Databricks AWS account principal to assume the role, optionally with an external ID for confused deputy protection. This meets the no-long-lived-keys requirement and is the standard secure configuration.

Why this answer

For Unity Catalog to access S3 without long-lived AWS keys, a storage credential must reference an IAM role that Databricks assumes. The role's trust policy must permit the Databricks AWS account to assume it, and an external ID can be used to prevent the confused deputy problem. This design centralizes credential management and avoids storing static keys.

Exam trap

The trap here is thinking that an instance profile or a Databricks service principal can serve as a Unity Catalog storage credential for S3, when the supported method is an IAM role with a trust policy.

112
Multi-Selectmedium

A Data Engineer is setting up Lakehouse Federation for a PostgreSQL database. Which TWO steps are required to ensure that users can securely query the data using Unity Catalog?

Select 2 answers
A.Create a connection object with appropriate credentials in Unity Catalog.
B.Ingest all PostgreSQL data into a S3 bucket first.
C.Create a foreign catalog that references the PostgreSQL connection.
D.Install a custom JDBC driver on every user's local machine.
E.Configure a VPC peering connection to the external database.
AnswersA, C

Creating a connection object is the first step. It encapsulates the connection details (URL, driver, etc.) and credentials (e.g., username/password or secret) in a secure manner. This object is stored in Unity Catalog, allowing administrators to manage access centrally and providing compute clusters with necessary information to access.

Why this answer

To set up Lakehouse Federation, you must first establish a connection object that stores credentials securely in Unity Catalog. Then, you must create a foreign catalog that maps the remote database to a local Unity Catalog structure. These two steps enable Unity Catalog to manage permissions and translate queries for the federated source without exposing raw credentials to end users.

Exam trap

Candidates often think querying external databases requires manual table replication or creating local views, skipping the required Unity Catalog connection and foreign catalog steps.

113
Multi-Selecthard

Which THREE actions are required to properly implement a secure data sharing strategy using Delta Sharing?

Select 3 answers
A.Create a SHARE object containing the tables to be shared.
B.Configure a RECIPIENT object representing the external partner.
C.Grant the recipient access to the underlying S3 bucket directly.
D.Execute a GRANT SHARE command to link the SHARE and RECIPIENT objects.
E.Copy the data to a public-facing S3 bucket for easier access.
AnswersA, B, D

The SHARE object is the container in Unity Catalog that bundles the datasets intended for distribution. Without creating this object, there is no mechanism to group the tables or views for the recipient, making it impossible to manage the scope of data being exposed to the external parties.

Why this answer

Delta Sharing provides a secure way to share data without replication. Implementing it requires creating a sharing object, defining the recipients, and granting access to specific tables. This ensures that only authorized entities can access the data, maintaining strict governance.

By abstracting the data access from the storage location, organizations can share data securely with external partners while retaining full control over who has access and when that access is revoked.

Exam trap

Candidates often forget the specific order or the need for a RECIPIENT object, incorrectly assuming that sharing is done by simply granting table access to a user's email address.

114
MCQeasy

A data engineer is setting up a Delta Share to provide a partner with access to a specific table. The partner uses Databricks and wants to query the shared data using their own Databricks workspace. What is the correct sequence of actions for the data engineer to enable this Databricks-to-Databricks sharing?

A.Create a share, add the table, create a recipient of type Databricks, and grant the recipient access to the share.
B.Export the table to a cloud storage location and provide the partner with the storage credentials.
C.Create a share, add the table, generate a credential file, and send it to the partner.
D.Grant the partner's Databricks workspace SELECT privileges on the table, and they can query it directly.
AnswerA

For Databricks-to-Databricks sharing, the provider creates a share, adds the table, creates a recipient with the Databricks sharing identifier, and grants the recipient access to the share. The recipient then mounts the share in their workspace. This sequence ensures proper authentication and access control.

Why this answer

Databricks-to-Databricks sharing uses Unity Catalog to create a share, add tables, and define a recipient using the partner's Databricks sharing identifier. The recipient is then granted access to the share. The partner mounts the share in their workspace, enabling them to query the data with their own compute.

This method avoids credential files and ensures secure, real-time access.

Exam trap

The trap here is thinking that a credential file is needed for Databricks-to-Databricks sharing, but that is only for non-Databricks recipients.

115
MCQhard

A data engineer is tuning a Spark job that reads from a Delta table and writes to another Delta table. The job uses a groupByKey operation followed by an aggregation. The engineer notices that the job is spilling to disk during the shuffle and taking a long time. The engineer wants to reduce shuffle spill and improve performance. Which action is most likely to help?

A.Increase the number of shuffle partitions to reduce the amount of data per partition.
B.Increase the executor memory and enable off-heap memory for the shuffle.
C.Replace groupByKey with reduceByKey or aggregateByKey to perform map-side aggregation.
D.Set spark.sql.shuffle.partitions to a very high value and enable adaptive query execution.
AnswerC

groupByKey shuffles all key-value pairs without map-side aggregation, causing large data transfers and spill. reduceByKey or aggregateByKey perform partial aggregation on the map side before shuffling, significantly reducing the amount of data shuffled and the memory pressure. This directly reduces spill and improves performance for aggregation workloads, and it is a best practice in Spark.

Why this answer

Replacing groupByKey with reduceByKey or aggregateByKey enables map-side aggregation, which reduces the volume of data shuffled and thus reduces spill and improves performance. Other options either add overhead, do not address the root cause, or are costly workarounds that do not fix the fundamental inefficiency.

Exam trap

The trap here is assuming that more partitions or more memory will solve shuffle spill, when the real fix is reducing the amount of data shuffled by using map-side aggregation.

116
Multi-Selectmedium

Which THREE of the following are benefits of using Delta Lake over standard Parquet files in Databricks?

Select 3 answers
A.ACID transactions
B.Native support for schema enforcement
C.Automatic file compaction to remove Parquet footer bloat
D.Time travel via transaction log history
E.Automatic conversion from CSV to Parquet on read
AnswersA, B, D

Delta Lake uses transaction logs to ensure that all operations are atomic and consistent. This prevents partial writes, where only some files are updated during a failure, ensuring that readers always see a consistent, valid state of the data regardless of concurrent write operations.

Why this answer

Delta Lake provides a robust layer of reliability and performance features on top of Parquet. ACID transactions ensure data consistency during concurrent writes. Schema enforcement prevents data corruption by rejecting non-conforming writes, while time travel allows for auditing and disaster recovery.

These capabilities are fundamental to modern Lakehouse architectures, as they bridge the gap between reliable data warehousing and the flexibility of cloud object storage.

Exam trap

Examinees often select features specific to traditional relational databases or stream processors, forgetting that Delta Lake natively provides ACID transactions and schema enforcement.

117
MCQeasy

A data engineer is using Databricks Auto Loader to ingest CSV files into a Delta table. The engineer notices that some files have a different delimiter (semicolon instead of comma). Which option should be used to handle this variation?

A.Set the cloudFiles.schemaEvolutionMode to 'addNewColumns' to handle delimiter changes.
B.Use the cloudFiles.format option with a custom delimiter per file.
C.Set the delimiter option to ';' for all files.
D.Preprocess the files to standardize the delimiter before ingestion.
AnswerD

Preprocessing the files to use a consistent delimiter (e.g., comma) is the most reliable approach. Auto Loader expects a uniform format; by standardizing delimiters, you ensure correct parsing. This can be done with a separate job or using a Databricks notebook to rewrite files. It avoids ingestion failures and data corruption.

Why this answer

The correct approach is to preprocess the files to standardize the delimiter before ingestion. Auto Loader does not support per-file delimiter detection; it requires a consistent format. By converting all files to a common delimiter, you ensure that Auto Loader parses them correctly and ingests data without errors.

This is a common preprocessing step in data pipelines.

Exam trap

The trap here is assuming Auto Loader can automatically detect and handle different delimiters, but it requires a consistent delimiter across all files.

118
Multi-Selecthard

A data engineer is designing a Gold layer table that must support slowly changing dimension (SCD) Type 2 for a customer dimension. The source data arrives daily with updates to customer attributes. The engineer wants to implement this using Delta Lake. Which two features or techniques are essential for maintaining SCD Type 2? (Choose two.)

Select 2 answers
A.Using Delta Lake's generated columns for surrogate keys
B.Partitioning the dimension table by effective_start_date
C.MERGE INTO with condition on business key and effective dates
D.Delta Lake time travel to query previous versions
E.Adding columns for effective start date, end date, and current flag
AnswersC, E

MERGE INTO is essential for SCD Type 2 because it allows updating existing records (e.g., setting end dates) and inserting new versions in a single atomic operation. By joining on the business key and comparing effective dates, you can expire old rows and add new ones. This ensures historical accuracy and ACID compliance in Delta Lake.

Why this answer

SCD Type 2 requires a mechanism to expire old records and insert new ones, which is achieved with MERGE INTO. Additionally, the dimension table must include columns to track the validity period of each version, such as effective dates and a current flag. Time travel, generated columns, and partitioning are not essential for implementing SCD Type 2.

Exam trap

The trap here is confusing time travel with SCD Type 2 maintenance; time travel is for reading historical snapshots, not for managing dimension history.

119
MCQeasy

A retail company wants to analyze sales by product, store, and date. The data team is designing the Gold layer and needs to choose between a star schema and a snowflake schema. Which factor most strongly favors a star schema in a Databricks Lakehouse?

A.Star schemas simplify queries and improve performance by minimizing joins.
B.Star schemas reduce data redundancy by normalizing dimension tables.
C.Star schemas enforce referential integrity through foreign key constraints.
D.Star schemas require less storage space than snowflake schemas.
AnswerA

Star schemas use denormalized dimensions, which reduces the number of joins needed for analytical queries. This simplicity leads to faster query performance, especially in a Lakehouse where join operations can be expensive. Databricks' Photon engine and Delta Lake optimizations work well with star schemas. This is a key reason to choose a star schema.

Why this answer

Star schemas minimize joins by denormalizing dimensions, which simplifies queries and boosts performance. In Databricks, this aligns well with Delta Lake and Photon optimizations. Snowflake schemas normalize dimensions, increasing joins and complexity.

Storage and referential integrity are not primary advantages of star schemas.

Exam trap

The trap here is assuming that star schemas reduce redundancy, but they actually increase redundancy to improve query performance.

120
MCQmedium

A data engineer at a healthcare company needs to share a Delta table containing patient records with an external research partner. The partner must only see aggregated statistics, not individual patient rows. The engineer wants to enforce this at the data sharing layer without creating a separate physical copy of the table. Which approach should the engineer take?

A.Create a Delta Share and add the table with a partition filter that excludes sensitive columns.
B.Export the aggregated data to a CSV file and provide it to the partner via a secure file transfer.
C.Use Lakehouse Federation to create a foreign catalog pointing to the partner's database and grant SELECT on the aggregated columns.
D.Create a view that aggregates the data and share the view through Delta Sharing.
AnswerD

Delta Sharing supports sharing views, including views that aggregate data. By creating a view that computes the required statistics, the engineer can share only the aggregated results. The partner queries the view as if it were a table, but the underlying raw data remains protected. This enforces the aggregation logic at the data sharing layer without duplicating data, and the view definition is managed centrally in Unity Catalog.

Why this answer

Delta Sharing allows sharing views that can perform aggregation and filtering, enabling fine-grained control over what data is exposed. Sharing an aggregated view ensures the partner sees only summary statistics, not raw patient records. This approach avoids data duplication and maintains centralized governance.

The other options either do not support the required granularity or are not designed for external sharing.

Exam trap

The trap here is assuming that Delta Sharing supports column-level security or partition filters to hide sensitive columns, when in fact it requires a view to achieve that level of control.

121
MCQmedium

A data engineer wants to monitor the health of Delta Live Tables (DLT) pipelines and be alerted if a pipeline fails. Which approach is the most efficient and native way to achieve this?

A.Configure an external cron job to poll the Databricks Jobs API every minute for status updates.
B.Enable the 'Log to Workspace' feature and manually query the system logs using SQL every hour.
C.Define a Notification Destination in the DLT pipeline settings and associate it with the 'On failure' event.
D.Use the Databricks SQL Alerts tool to monitor the underlying Delta tables for new record counts.
AnswerC

Defining a Notification Destination is the recommended, built-in feature for monitoring pipeline lifecycle events. It ensures that failure notifications are sent directly to the specified endpoint, such as email or Webhooks. This approach is highly reliable, scalable, and simplifies management by centralizing monitoring configuration within the DLT pipeline definition itself.

Why this answer

Using Notification Destinations in the DLT pipeline settings is the most native method. It allows engineers to configure email or Slack alerts directly within the UI or JSON configuration. This is crucial for production reliability, ensuring that stakeholders receive immediate notifications regarding job failures or data quality issues without needing external orchestration or custom API scripts, maintaining observability across the entire pipeline lifecycle.

Exam trap

Candidates frequently assume they need external orchestration tools or custom webhook scripts to monitor DLT pipelines, ignoring native pipeline settings.

122
MCQhard

A healthcare company uses a Databricks Lakehouse. The Silver layer contains a table patient_visits that is updated with late-arriving data. The table is partitioned by visit_date. The data engineering team needs to efficiently merge new data that may include updates to existing records and inserts of new records. They want to minimize the impact on existing data and ensure ACID compliance. Which Delta Lake operation should they use?

A.Use Delta Lake change data feed to apply changes.
B.INSERT OVERWRITE patient_visits SELECT * FROM new_data
C.DELETE FROM patient_visits WHERE visit_id IN (SELECT visit_id FROM new_data); INSERT INTO patient_visits SELECT * FROM new_data
D.MERGE INTO patient_visits USING new_data ON patient_visits.visit_id = new_data.visit_id WHEN MATCHED THEN UPDATE SET * WHEN NOT MATCHED THEN INSERT *
AnswerD

The MERGE operation allows for efficient upserts by matching on visit_id. It updates existing records and inserts new ones in a single ACID transaction, minimizing data rewriting. This is the standard approach for handling late-arriving data in Delta Lake and ensures atomicity and consistency.

Why this answer

The MERGE statement is designed for upserts, allowing updates to existing records and inserts of new records in one atomic operation. It minimizes data rewriting by only touching affected files and maintains ACID compliance. Other options either overwrite data, are non-atomic, or do not apply changes.

Exam trap

The trap here is using INSERT OVERWRITE or a delete-then-insert pattern, which can lead to data loss or non-atomic operations.

123
MCQeasy

A data engineer needs to receive an email notification when a Databricks job fails. The job is scheduled to run every hour. The engineer wants to configure this notification with minimal effort and without writing additional code. Which approach should the engineer use?

A.Create a Databricks SQL alert that queries the job's run history and triggers when a failure is detected.
B.Use the Databricks REST API to poll the job status every hour and send an email if the status is failed.
C.Configure the job's email notifications in the job settings to send alerts on failure to the engineer's email address.
D.Set up a webhook in the job configuration to call an external service that sends an email.
AnswerC

Databricks jobs have built-in email notification settings that can be configured directly in the job UI or via the API. Enabling failure notifications sends an email to specified recipients when the job fails. This requires no additional code and is the simplest way to meet the requirement.

Why this answer

Databricks jobs include built-in email notification settings that can be configured to send alerts on failure. This is the most straightforward and code-free method to receive email notifications for job failures, meeting the engineer's requirements for minimal effort.

Exam trap

The trap here is overcomplicating the solution by considering external services or custom polling, when the job's native notification settings already provide the required functionality without extra work.

124
MCQmedium

A data engineer needs to grant a new data analyst the ability to query tables in the `sales` catalog, which is in Unity Catalog. The analyst should only be able to read data and not modify any tables or metadata. Which sequence of privileges should the engineer grant to the analyst?

A.Grant `ALL PRIVILEGES` on the catalog and rely on table-level `SELECT` to restrict modifications.
B.Grant `USE CATALOG` on `sales` and `SELECT` on all tables, without schema-level privileges.
C.Grant `USE CATALOG` on `sales`, `USE SCHEMA` on all schemas, and `SELECT` on all tables.
D.Grant `BROWSE` on the catalog, `READ VOLUME` on all volumes, and `SELECT` on all tables.
AnswerC

To query tables in Unity Catalog, a user needs `USE CATALOG` on the catalog, `USE SCHEMA` on the schema, and `SELECT` on the tables. This sequence grants the minimum privileges required for read-only access. It does not include any write or modify privileges, ensuring the analyst cannot alter data or metadata.

Why this answer

In Unity Catalog, querying a table requires a chain of privileges: `USE CATALOG` on the catalog, `USE SCHEMA` on the schema, and `SELECT` on the table. Granting these three privileges provides read-only access without allowing any modifications. This follows the principle of least privilege and ensures the analyst can only read data as required.

Exam trap

The trap here is forgetting that `USE SCHEMA` is required in addition to `USE CATALOG` and `SELECT`, or assuming that `BROWSE` or `ALL PRIVILEGES` can substitute for the necessary read-only privileges.

125
MCQhard

A data engineer is tuning a Spark job and decides to use 'Z-Ordering' on a Delta table. Which THREE of the following are valid considerations when selecting columns for Z-Ordering?

A.Columns with high cardinality are generally better candidates.
B.You should Z-Order on every column to maximize performance.
C.Z-Ordering should be applied to columns frequently used in WHERE clauses.
D.Z-Ordering is most effective on columns that are never filtered.
E.Z-Ordering significantly improves performance for joins on the indexed column.
AnswerA, C, E

High-cardinality columns allow for more effective data clustering. By grouping similar values together, the engine can skip large chunks of data that do not meet the filter criteria. This is the primary mechanism by which Z-Ordering improves query performance compared to basic partitioning schemes.

Why this answer

Z-Ordering improves data skipping by clustering related information in the same set of files. Choosing the right columns is crucial; high-cardinality columns with frequent filter predicates are ideal. Excessive Z-Ordering can lead to high maintenance costs and metadata overhead.

Mastering this technique is essential for performance tuning in Databricks, as it drastically reduces the amount of data read during query execution, directly impacting both latency and cloud infrastructure costs.

Exam trap

Candidates often suggest Z-Ordering on all columns or low-cardinality columns. This increases metadata overhead and provides zero performance benefit, as Z-Ordering is ineffective for columns with few unique values.

126
MCQhard

A data engineer is implementing a Structured Streaming job that reads from a Kafka topic and writes to a Delta table. The engineer needs to ensure that the job can recover from failures without data loss or duplication. The job uses foreachBatch to perform upserts into the Delta table. Which checkpointing configuration is required to achieve exactly-once semantics?

A.Set the checkpointLocation to a reliable distributed storage path and ensure the Delta table write is idempotent using merge.
B.Use the option 'startingOffsets' set to 'latest' and enable trigger once for the streaming query.
C.Set the checkpointLocation to a local path on the driver and use append mode for the Delta table write.
D.Set the Spark configuration spark.sql.streaming.checkpointLocation to a DBFS path and use complete mode for the Delta table write.
AnswerA

Exactly-once semantics in Structured Streaming with foreachBatch require a reliable checkpoint location to track progress and idempotent writes to handle reprocessing. Using MERGE for upserts makes the write idempotent, so replays do not duplicate data. The checkpoint stores offsets and state, enabling recovery. This combination ensures exactly-once processing even after failures.

Why this answer

Exactly-once semantics in Structured Streaming require a reliable checkpoint location to track progress and idempotent writes to handle reprocessing. Using foreachBatch with MERGE provides idempotent upserts, and a distributed checkpoint location ensures recovery. The other options either use unreliable storage, non-idempotent writes, or unsupported write modes, failing to guarantee exactly-once.

Exam trap

The trap here is assuming that any checkpoint location suffices, but a local path is not fault-tolerant, and append mode can duplicate data on replay.

127
MCQeasy

A data engineer is building a Silver layer table that combines data from multiple Bronze tables. The engineer wants to ensure that the Silver table only contains the most recent version of each record based on a 'last_updated' timestamp. Which Delta Lake operation should be used to achieve this?

A.DELETE then INSERT the new records
B.Use Delta Lake time travel to revert to a previous version
C.INSERT OVERWRITE with the entire dataset
D.MERGE INTO with a condition that updates when the source timestamp is greater
AnswerD

MERGE INTO allows you to update existing records when the incoming data has a newer timestamp and insert new records when they don't exist. This ensures that the Silver table always reflects the latest version. It is the standard way to upsert data in Delta Lake while maintaining ACID compliance.

Why this answer

MERGE INTO is the correct operation because it can conditionally update existing rows with newer timestamps and insert new rows, ensuring the Silver table contains only the latest version of each record. INSERT OVERWRITE, DELETE+INSERT, and time travel do not provide the same atomic upsert capability and would either be inefficient or incorrect for this scenario.

Exam trap

The trap here is thinking that INSERT OVERWRITE is sufficient for incremental updates, but it actually replaces all data and does not handle record-level versioning.

128
MCQhard

Refer to the exhibit. A data engineer executes this command in a Unity Catalog-enabled workspace. What is the immediate effect on the 'analyst_group'?

A.The group gains permission to read data but not to modify table metadata.
B.The group gains ownership of the table, allowing them to drop it.
C.The command fails because 'main.sales.orders' is not a fully qualified name.
D.The group gains access to both the data and the underlying S3 files directly.
AnswerA

The 'SELECT' privilege specifically allows for data retrieval from the table. It does not grant 'MODIFY' or 'OWNER' privileges, meaning the group cannot change the schema, drop the table, or alter metadata. This maintains a clean separation of duties between data consumers and data owners within the environment.

Why this answer

The command grants 'SELECT' privileges on the 'orders' table to the 'analyst_group' within the 'sales' schema of the 'main' catalog. This is a standard Unity Catalog operation that enables users within the group to query the table. Understanding these permissions is vital for auditors and engineers managing data access lifecycle, ensuring only authorized groups can read sensitive business records.

Exam trap

Examinees often confuse SELECT privileges with ALL PRIVILEGES or MODIFY, assuming that read access also grants the ability to alter table definitions.

129
MCQeasy

Where can a data engineer find the standard output and error logs for a specific task within a Databricks Workflow?

A.In the Databricks Filesystem (DBFS) root directory under /logs.
B.By clicking the 'Logs' tab within the specific task run details in the Jobs UI.
C.By querying the 'sys.logs' table in the Unity Catalog.
D.In the cluster configuration's 'Advanced Options' tab.
AnswerB

The Jobs UI provides a 'Logs' tab that captures stdout, stderr, and log4j outputs for every task execution. This is the official, supported way to view execution logs within the Databricks workspace, allowing engineers to quickly debug failures without leaving the browser or using complex CLI commands.

Why this answer

Databricks provides a comprehensive UI that aggregates logs for every task execution. By navigating to the job run and selecting the specific task, the engineer can view stdout and stderr logs directly. This is the primary method for diagnosing runtime exceptions, syntax errors, or logic failures in automated data pipelines, facilitating rapid troubleshooting without needing external tools or direct node access.

Exam trap

Candidates often look for logs in the cluster driver tab or external cloud storage buckets. They miss that the Jobs UI provides a direct, aggregated view of task-specific logs.

130
MCQeasy

A data engineer is designing a pipeline and notices that the cost of processing is unexpectedly high during development. Which action provides the most immediate cost reduction when using Databricks?

A.Switching to a more expensive instance type to complete the job faster.
B.Enabling Photon acceleration for all development workloads.
C.Utilizing Spot instances for non-critical development and test clusters.
D.Increasing the number of workers in the cluster to handle more data in parallel.
AnswerC

Spot instances offer significant cost savings compared to On-Demand instances. By using them for development or non-time-critical processing, you can reduce the infrastructure bill by up to 80%. This is the most effective immediate strategy for cost management without impacting the actual logic or performance of the pipeline.

Why this answer

Choosing the right instance type and using Spot/Preemptible instances is a foundational cost-optimization strategy. Spot instances leverage unused cloud capacity at significantly lower prices compared to On-Demand instances. While they can be reclaimed by the cloud provider, using them for development, testing, or fault-tolerant batch jobs is a highly effective way to slash cloud infrastructure spending without altering the underlying code or business logic of the data pipeline.

Exam trap

Test-takers often recommend rewriting application logic or optimizing code, overlooking infrastructure choices like Spot instances that provide immediate, zero-code cost reduction.

131
MCQmedium

When refining data in a Medallion architecture, why is it recommended to perform schema enforcement as early as possible in the Bronze layer?

A.It eliminates the need for any further schema validation in the Silver or Gold layers.
B.It ensures that the storage cost of the Bronze layer is kept at a minimum.
C.It prevents malformed data from polluting downstream layers and makes debugging easier.
D.It automatically converts all incoming file formats into the optimal Delta format.
AnswerC

Enforcing schema early is the most effective way to identify and fix data quality issues before they become deeply embedded in the refined datasets. By ensuring the Bronze layer is consistent, you simplify the entire transformation pipeline, making it easier to pinpoint the source of any issues when they arise.

Why this answer

Early enforcement catches errors at the ingestion point, preventing corrupt data from propagating into Silver or Gold layers. This practice keeps the 'upstream' data quality high, reducing the need for costly, complex fixes in downstream tables. It ensures that the Medallion architecture remains clean and reliable, minimizing the time spent debugging issues that could have been resolved at the very first step of the data pipeline.

Exam trap

Candidates often believe schema enforcement should happen in the Silver layer after cleaning. They ignore that cleaning data is significantly harder once malformed records have already entered the system.

132
MCQmedium

A data engineer is building a Structured Streaming job that reads from a Kafka topic and writes to a Delta table. The pipeline must tolerate late-arriving data up to 10 minutes and update aggregations accordingly. The engineer wants to use a watermark on the event-time column. Which code snippet correctly applies the watermark and performs a 5-minute tumbling window aggregation?

A.df.withWatermark("event_time", "10 minutes").groupBy("event_time").count()
B.df.withWatermark("event_time", "10 minutes").groupBy(window("event_time", "5 minutes")).count()
C.df.withWatermark("event_time", "5 minutes").groupBy(window("event_time", "10 minutes")).count()
D.df.groupBy(window("event_time", "5 minutes")).count().withWatermark("event_time", "10 minutes")
AnswerB

This correctly applies a watermark of 10 minutes on the event_time column, allowing late data up to that threshold, and then groups by a 5-minute tumbling window. The watermark is set before the aggregation, which is required for streaming aggregations. This matches the requirement to tolerate late data and compute windowed counts.

Why this answer

The correct approach is to apply the watermark on the event-time column before the aggregation, with a delay that matches the late-data tolerance (10 minutes). The aggregation must use a window of the desired size (5 minutes). Placing the watermark after the aggregation or using mismatched durations leads to incorrect results or errors.

Exam trap

The trap here is assuming the watermark can be applied after the aggregation or that its duration must match the window size.

133
MCQmedium

A data engineering team maintains a Unity Catalog metastore in a Databricks workspace. They need to provide an external partner with read-only access to a specific Delta table, but the partner's analytics platform is not Databricks and does not support the Delta Lake protocol. The partner can consume Parquet files over a REST API. Which Unity Catalog feature should the team use to share the table?

A.Unity Catalog Volumes
B.Databricks SQL Connector for Python
C.Delta Sharing
D.Lakehouse Federation
AnswerC

Delta Sharing is an open protocol that allows sharing Delta tables with external recipients, including non-Databricks clients, via a REST API. It automatically serves the shared data in Parquet format to recipients that do not support Delta, enabling seamless access. This matches the partner's requirement exactly and is the native Unity Catalog sharing feature for this scenario.

Why this answer

Delta Sharing is the correct choice because it is the only Unity Catalog feature designed to share Delta tables externally using an open REST protocol. It supports recipients on non-Databricks platforms by serving data as Parquet, which aligns with the partner's capabilities. The other options serve different purposes: Volumes store files, Lakehouse Federation queries external systems, and the SQL Connector is a client library.

Exam trap

The trap here is confusing Delta Sharing with Lakehouse Federation, which is used to query external data sources from Databricks, not to share data outward.

134
MCQhard

Refer to the exhibit. Which configuration change is required to enable multiple instances of this job to run simultaneously?

A.Increase the timeout threshold for the job.
B.Set max_concurrent_runs to a value greater than 1 in the job settings.
C.Add more workers to the cluster assigned to the job.
D.Enable 'Retries' in the job configuration.
AnswerB

The max_concurrent_runs parameter controls how many instances of a job can execute at the same time. Setting this to a value higher than 1 allows the job to be triggered even if a previous run is still in progress, enabling parallel processing of independent data workflows.

Why this answer

The error message explicitly states that the job does not allow concurrent runs. By default, many jobs are configured for single-instance execution to prevent data contention or race conditions. To allow overlapping executions, the 'max_concurrent_runs' parameter must be adjusted in the job settings.

This is a critical configuration for scenarios where independent data partitions need to be processed in parallel to meet aggressive latency requirements in a production system.

Exam trap

Candidates often look for code-level synchronization locks or cluster scaling options, missing that Databricks job settings explicitly block concurrent runs by default.

135
Multi-Selecthard

A data engineer is troubleshooting a Databricks job that fails with a 'TaskFailed' error. The job uses a cluster with autoscaling enabled. The engineer suspects that the failure is due to memory issues on the workers. Which TWO actions should the engineer take to diagnose and resolve the issue? (Choose two.)

Select 2 answers
A.Increase the driver node's memory to handle the failing tasks.
B.Increase the number of partitions when reading the data to reduce per-task memory usage.
C.Disable autoscaling to ensure the cluster has a fixed number of workers.
D.Check the cluster's event log for 'ExecutorLostFailure' events indicating out-of-memory errors.
E.Review the Spark UI for the job's run to identify stages with high garbage collection time or spill.
AnswersD, E

The cluster event log records executor losses and out-of-memory errors. 'ExecutorLostFailure' often indicates that an executor was killed due to memory limits. Reviewing the event log helps confirm if memory is the culprit and provides details such as which executor failed and why. This is a key diagnostic step.

Why this answer

To diagnose memory issues, the engineer should use the Spark UI to examine memory-related metrics such as garbage collection and spill, and check the cluster event log for executor out-of-memory errors. These steps confirm whether memory is the bottleneck. Once confirmed, the engineer can adjust cluster configuration, such as increasing executor memory or optimizing the job.

Disabling autoscaling or increasing driver memory does not address worker memory problems, and increasing partitions is a potential fix but not a primary diagnostic step.

Exam trap

The trap here is assuming that driver memory or autoscaling settings are the cause, when the issue is likely per-executor memory and requires inspection of Spark UI and event logs.

136
MCQhard

Which property should be configured to allow Databricks to automatically optimize the size of files during write operations in Delta Lake?

A.spark.sql.shuffle.partitions
B.spark.databricks.delta.optimizeWrite.enabled
C.spark.databricks.io.cache.enabled
D.spark.sql.autoBroadcastJoinThreshold
AnswerB

This setting enables the optimize-write feature, which automatically compacts data into optimal file sizes during the write process. By doing this upfront, it prevents the creation of numerous small files, which is a major performance bottleneck for read-heavy analytical workloads on large Delta tables.

Why this answer

The `spark.databricks.delta.optimizeWrite.enabled` property is essential for write-time optimization. It dynamically groups data before writing to storage, ensuring that the created files are of optimal size. This prevents the small-file problem from occurring in the first place, reducing the need for post-write maintenance and improving read query performance significantly.

It is a proactive performance optimization that is highly recommended for high-frequency write workloads.

Exam trap

Students often confuse Auto Compact with Optimize Write, or suggest running manual OPTIMIZE commands instead of configuring the automatic write-time property.

137
MCQeasy

When partitioning a large Delta table, what is the best practice regarding the number of unique values in the partition column?

A.High cardinality is preferred for faster data skipping.
B.Low cardinality is preferred to avoid creating too many files.
C.Partitioning should always be done on a primary key column.
D.The number of unique values does not impact performance.
AnswerB

Low cardinality columns ensure that data is grouped into a reasonable number of directories. This prevents the generation of excessive small files, maintaining optimal read performance and reducing the overhead on the file system and the Spark planner during query planning and execution.

Why this answer

Choosing a column with too many unique values (high cardinality) for partitioning leads to the 'small files problem.' Each unique value creates a new directory, resulting in an explosion of small files that degrades performance during reads and writes. Best practices suggest partitioning by columns with low to medium cardinality (e.g., date, region) to ensure balanced file sizes and efficient data skipping during query execution.

Exam trap

Candidates often assume that more partitions are always better for performance. They fail to realize that high-cardinality columns lead to an excessive number of small files, severely degrading query performance.

138
Multi-Selecthard

A data engineer is responsible for monitoring a production Databricks job that runs critical ETL tasks. The job occasionally fails due to transient issues such as cloud storage throttling or network timeouts. The engineer wants to set up automated alerts that notify the team only when the job fails after all retries are exhausted. Which TWO actions should the engineer take to achieve this? (Choose two.)

Select 2 answers
A.Set up a Databricks SQL alert that queries the job run history and triggers when a run fails with a specific error code.
B.Enable notifications on the job to send an email or webhook when the job fails after retries.
C.Configure the job with a retry policy that specifies the number of retries and the interval between them.
D.Use the Databricks REST API to monitor job runs and trigger an alert via an external system when a run fails.
E.Create a scheduled notebook that checks the job status every minute and sends an alert if the status is FAILED.
AnswersB, C

Databricks jobs support built-in notifications that can be configured to fire on failure. When combined with a retry policy, these notifications are sent only after the job has exhausted its retries and ultimately fails. This is the native and most direct way to achieve the desired alerting behavior without custom code.

Why this answer

To alert only after all retries are exhausted, the engineer should configure a retry policy on the job and enable job notifications for failure. The retry policy handles transient issues automatically, and the notification fires only on final failure. Other methods either alert on every failure or require custom code to determine final failure status.

Exam trap

The trap here is assuming that any failure notification will suffice, when the requirement is to alert only after retries are exhausted, which is natively supported by combining retry policies with job notifications.

139
MCQhard

A data engineer is troubleshooting a Delta Live Tables pipeline that intermittently fails with 'StreamingQueryException: Job aborted due to stage failure'. The pipeline processes streaming data from a Kafka source. Which monitoring approach will best help identify the root cause of these intermittent failures?

A.Set up a Databricks SQL alert on the target Delta table's row count to detect missing data.
B.Use the Spark UI to inspect the DAG and stage details for each failed job run.
C.Enable and analyze the Delta Live Tables event log for detailed error messages and stack traces.
D.Monitor the cluster's CPU and memory utilization metrics in the Databricks workspace.
AnswerC

The Delta Live Tables event log captures detailed information about pipeline runs, including error messages, stack traces, and data quality metrics. For intermittent streaming failures, this log provides the granular context needed to pinpoint the exact cause, such as deserialization errors or Kafka connectivity issues, making it the most effective monitoring tool for this scenario.

Why this answer

The Delta Live Tables event log is the centralized source for pipeline run details, including error messages and stack traces. For intermittent streaming failures, it offers the most direct and detailed diagnostic information. Other monitoring tools either focus on resource usage or lack the necessary error context, making them less effective for root cause analysis in this scenario.

Exam trap

The trap here is assuming that general cluster metrics or Spark UI will provide sufficient error details, when the DLT event log is specifically designed to capture pipeline-level exceptions.

140
MCQhard

A Data Engineer is using Delta Live Tables (DLT) to build a pipeline that ingests JSON files from cloud storage. The engineer defines a streaming table with expectations to enforce data quality. The expectation `@dlt.expect_or_drop("valid_timestamp", "timestamp IS NOT NULL")` is applied. During a pipeline run, 5% of records have a NULL timestamp. What is the outcome for those records, and how does it affect the pipeline?

A.The records with NULL timestamp are dropped from the target table, and the pipeline continues processing without failure.
B.The records with NULL timestamp are dropped, and the pipeline fails after processing the batch due to the drop threshold being exceeded.
C.The records with NULL timestamp are quarantined in a separate table, and the pipeline fails with an error.
D.The records with NULL timestamp are retained in the target table, but the pipeline fails with a data quality error.
AnswerA

The `expect_or_drop` decorator instructs DLT to drop records that violate the expectation and continue processing. The dropped records are not written to the target table, but the pipeline does not fail. Metrics are recorded to track the number of dropped records. This allows the pipeline to maintain data quality while handling invalid data gracefully, which is the intended behavior for this expectation.

Why this answer

The `expect_or_drop` expectation drops records that violate the condition and allows the pipeline to continue. It does not quarantine records, retain them, or fail the pipeline. This behavior is designed to handle data quality issues without interrupting processing, while still providing metrics on dropped records.

Exam trap

The trap here is assuming that `expect_or_drop` quarantines records or fails the pipeline, when it simply drops them and continues.

141
MCQeasy

A data engineer is using Auto Loader to ingest JSON files from cloud storage into a Delta table. The files contain a nested field 'address' with subfields 'city' and 'zip'. The engineer wants to flatten the nested structure during ingestion so that 'city' and 'zip' become top-level columns in the Bronze table. Which Auto Loader feature should be used to achieve this?

A.Apply a select transformation with col('address.city') and col('address.zip') after reading the stream.
B.Set cloudFiles.flattenNested to true in the Auto Loader options.
C.Use the cloudFiles.schemaEvolutionMode set to 'addNewColumns' to automatically flatten nested fields.
D.Set cloudFiles.schemaHints to specify the nested fields as top-level columns.
AnswerA

Auto Loader does not have a built-in flattening option; flattening is achieved through DataFrame transformations. After reading the stream with Auto Loader, you can use select or withColumn to extract nested fields into top-level columns. For example, selecting col('address.city').alias('city') and col('address.zip').alias('zip') will produce the desired flat schema. This is the standard approach for flattening nested data during ingestion.

Why this answer

Auto Loader ingests data with its original nested structure. To flatten nested fields into top-level columns, you must apply DataFrame transformations after reading the stream. Using select or withColumn to extract subfields like address.city and address.zip is the correct method.

Auto Loader does not have a built-in flattening feature, so transformations are required.

Exam trap

The trap here is assuming that Auto Loader has a configuration option to flatten nested data automatically, when in fact flattening must be done via DataFrame operations after ingestion.

142
Multi-Selectmedium

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

Select 2 answers
A.It provides automated, column-level lineage tracking for SQL and Python workloads.
B.It forces all data to be stored in a single, centrally managed S3 bucket.
C.It enables visibility into dependencies between datasets across different workspaces.
D.It automatically encrypts all data at rest using customer-managed keys.
E.It allows users to manually edit the lineage graph to include external data sources.
AnswersA, C

Unity Catalog integrates directly with the Databricks engine to track data movement, including column-level transformations. This automated capture ensures that lineage information is always up-to-date, removing the need for manual documentation or external tools that often fall out of sync with the actual data processing logic implemented in the notebooks.

Why this answer

Unity Catalog automatically captures lineage at the table and column level for queries executed on the platform. This metadata is crucial for impact analysis and compliance auditing. By providing a unified view of how data moves from source to destination, organizations can maintain transparency, satisfy regulatory requirements for data tracking, and easily debug complex ETL pipelines that span across multiple workspaces and various cloud storage locations.

Exam trap

Students sometimes believe lineage tracking is restricted to manual documentation or table-level only, missing its automated column-level capabilities.

143
MCQmedium

When migrating to Unity Catalog, what is the best practice for managing existing data access permissions?

A.Automatically import all Hive Metastore permissions during migration.
B.Implement a role-based access control (RBAC) model in Unity Catalog.
C.Grant every user 'ADMIN' access to simplify the migration process.
D.Use the metastore owner's credentials for all data access.
AnswerB

RBAC is the gold standard for enterprise governance. By creating functional roles and assigning them to groups in Unity Catalog, you ensure that permissions are consistent, easy to manage, and auditable. This approach scales much better than assigning permissions to individual users and avoids the complexity of manual, ad-hoc access management.

Why this answer

Adopting the principle of least privilege during migration is essential. By reviewing and re-granting permissions in the new Unity Catalog environment, you can eliminate legacy security debt and ensure that only necessary access is provided. This is the perfect opportunity to implement a robust, role-based access control (RBAC) model, ensuring the new environment is more secure than the legacy Hive Metastore it replaces, and facilitating long-term compliance.

Exam trap

Candidates often suggest migrating permissions 'as-is' from the Hive Metastore. This carries over legacy security debt and fails to take advantage of Unity Catalog's superior, centralized RBAC capabilities.

144
MCQmedium

A data engineer manages a Databricks SQL warehouse that serves a dashboard used by the finance team. The dashboard queries have become slow during peak hours, and the engineer suspects that some queries are scanning excessive data. Which system table should the engineer query to analyze query performance and identify expensive queries?

A.system.billing.usage
B.system.access.audit
C.system.compute.node_timeline
D.system.query.history
AnswerD

system.query.history contains detailed records of query executions, including query text, duration, rows read, bytes scanned, and user information. By querying this table, the engineer can identify long-running or high-scan queries that impact dashboard performance. This is the correct system table for analyzing query performance in Databricks SQL.

Why this answer

The system.query.history table is designed for query observability in Databricks SQL. It captures execution details, including query duration, rows produced, and bytes read, enabling engineers to pinpoint inefficient queries. Other system tables focus on compute metrics, audit events, or billing, and lack the query-level performance data needed to troubleshoot slow dashboards.

Exam trap

The trap here is confusing system tables that track access or billing with those that track query performance, leading to selection of an audit or billing table instead of query history.

145
Multi-Selecthard

A data engineer is responsible for a Delta Live Tables pipeline that ingests streaming data from multiple sources. The pipeline occasionally experiences delays, and the engineer needs to monitor the pipeline's health. Which two metrics should the engineer monitor to detect ingestion backlog and processing latency? (Choose two.)

Select 2 answers
A.The 'processingTime' metric in the streaming query progress
B.The number of records in the event log with severity 'ERROR'
C.The 'numInputRows' metric in the streaming query progress
D.The number of DBUs consumed by the pipeline cluster
E.The total size of the Delta table in storage
AnswersA, C

processingTime measures how long each micro-batch takes to process. If this value consistently increases, it indicates that the pipeline is unable to keep up with the incoming data rate, leading to increased latency. Monitoring processingTime helps identify performance bottlenecks and potential backlog in Delta Live Tables streaming pipelines.

Why this answer

numInputRows and processingTime are key metrics in the streaming query progress that directly reflect ingestion rate and processing duration. Monitoring both allows the engineer to detect when the pipeline is not keeping up with the source, causing backlog and increased latency. Other metrics like error counts, DBU usage, or storage size do not provide the necessary real-time performance insight.

Exam trap

The trap here is focusing on cost or error metrics rather than the streaming-specific throughput and latency metrics that indicate whether the pipeline is falling behind.

146
MCQmedium

Which approach is most appropriate for ingesting data from a JDBC source into Delta Lake where the source table has no 'updated_at' or 'version' column for incremental loading?

A.Use the 'partitionColumn' parameter with a random UUID.
B.Perform a full overwrite of the Delta table for every load.
C.Enable streaming ingestion using the JDBC source readStream API.
D.Use the 'fetchSize' parameter to optimize the load.
AnswerB

Since there is no mechanism to identify changed data, performing a full overwrite ensures the target table always matches the source. This is the standard pattern for handling tables without watermark columns. You should balance the frequency of the load with the size of the table to manage compute costs.

Why this answer

When a source table lacks a watermark column, you cannot use standard incremental loading techniques. The most robust approach is a full overwrite of the destination table, ensuring that the target remains a faithful copy of the source. While this can be resource-intensive for large tables, it is the only way to ensure data integrity without primary keys or timestamps to track changes.

Exam trap

Candidates often suggest using MERGE or incremental ingestion logic even when no watermark column exists, forgetting that these techniques require a reliable way to identify new or modified records.

147
Multi-Selecthard

A Databricks SQL warehouse is experiencing high costs due to idle resources. Which TWO configurations should be implemented to effectively manage and reduce warehouse costs?

Select 2 answers
A.Set the auto-stop duration to a very low value, such as 1 minute, for serverless SQL warehouses.
B.Enable multi-cluster load balancing to ensure all queries are executed on the largest instance type.
C.Configure SQL warehouse scaling to use the maximum cluster size at all times to avoid resizing overhead.
D.Implement SQL query history monitoring to identify and optimize long-running or resource-intensive queries.
E.Disable the query cache to ensure all results are freshly computed for accurate billing metrics.
AnswersA, D

Serverless SQL warehouses support very fast startup times, making a 1-minute auto-stop duration feasible. This minimizes the period that the warehouse remains active while idle, ensuring that billing stops almost immediately after the last query finishes, which is highly effective for reducing costs in environments with intermittent usage.

Why this answer

Auto-stop and serverless scaling are the primary levers for cost control in Databricks SQL. Auto-stop terminates warehouses when no queries are running, preventing billing for idle time. Serverless SQL warehouses provide faster startup times and more granular scaling, allowing users to configure aggressive auto-stop durations without compromising user experience.

Together, these configurations ensure that compute resources are only consumed when active query processing is required, directly minimizing unnecessary cloud spending.

Exam trap

Exam takers often recommend cluster scaling down or increasing instance sizes to reduce SQL warehouse costs, overlooking that serverless auto-stop duration and query optimization are the primary levers.

148
MCQmedium

Which of the following describes the correct use of a UDF (User Defined Function) in PySpark for production pipelines?

A.Always write row-based Python UDFs for maximum flexibility.
B.Use Pandas UDFs to leverage vectorized operations and improve performance.
C.UDFs automatically optimize data distribution across the cluster.
D.UDFs are the most efficient way to perform simple string manipulation.
AnswerB

Pandas UDFs use Apache Arrow to transfer data in blocks rather than row-by-row. This vectorized approach drastically reduces the cost of serialization and deserialization, making them significantly faster than standard Python UDFs. They are the standard for custom logic in high-performance PySpark production pipelines when native functions are insufficient.

Why this answer

UDFs in PySpark move data from the JVM (Java Virtual Machine) to a Python process, which incurs significant serialization overhead. When possible, it is always best to use native Spark SQL functions, which operate directly on the JVM, providing better performance and native optimization by the Catalyst engine. If a UDF is unavoidable, using Pandas UDFs (Vectorized UDFs) with Apache Arrow is the recommended approach to minimize serialization costs.

Exam trap

Many candidates incorrectly recommend standard Python UDFs for performance gains, failing to realize that standard UDFs cause massive serialization overhead compared to Pandas UDFs.

149
MCQmedium

A data engineer at a healthcare company needs to share a Delta table containing patient records with an external research partner. The partner uses a non-Databricks platform and requires read-only access to the latest data, with updates reflected in near real-time. The engineer creates a Delta Share and adds the table. Which additional step is required to allow the partner to access the shared data?

A.Create a recipient object and provide the recipient with the activation link or credential file.
B.Configure a Databricks SQL warehouse and share its connection string with the recipient.
C.Grant the recipient's user account SELECT privileges on the shared table.
D.Generate a bearer token for the recipient and provide it along with the share name.
AnswerA

To share data with an external partner, you must create a recipient in Unity Catalog, which generates an activation link or a credential file. The recipient uses this to authenticate and access the share. This is the standard procedure for Delta Sharing to non-Databricks users, enabling secure, read-only access to the shared tables.

Why this answer

For a non-Databricks recipient to access a Delta Share, the provider must create a recipient object in Unity Catalog. This generates an activation link or credential file that the recipient uses to authenticate. The share must contain the table, and the recipient is granted access to the share.

This process ensures secure, read-only access without requiring the recipient to have a Databricks account.

Exam trap

The trap here is assuming that granting SELECT privileges on the table directly to an external user is sufficient, but Delta Sharing requires a recipient object and credential file for non-Databricks access.

150
MCQmedium

A data engineer is using Lakehouse Federation to query an external PostgreSQL database. The engineer creates a connection with the PostgreSQL JDBC URL and credentials, and then creates a foreign catalog. Users report that queries against foreign tables are slow and sometimes fail with connection timeouts. The engineer checks the connection and confirms the credentials are correct. What is the most likely cause of the performance and timeout issues?

A.The foreign catalog is not configured with a read-only mode, causing write attempts that time out.
B.The foreign catalog must be refreshed to update statistics, causing slow queries.
C.The Databricks cluster lacks the necessary network connectivity to the PostgreSQL database, causing timeouts.
D.The PostgreSQL database is not configured with the correct Unity Catalog connection parameters.
AnswerC

Lakehouse Federation queries are executed by the Databricks cluster, which must have network access to the external database. If the cluster is in a VPC without proper peering or firewall rules, connections may be slow or time out. Ensuring network connectivity, such as VPC peering or allowing Databricks IPs, is crucial for performance and reliability.

Why this answer

Lakehouse Federation queries run on Databricks compute, which must connect to the external database over the network. If the cluster cannot reach the database due to network restrictions, queries will be slow or time out. Ensuring proper network connectivity, such as VPC peering or firewall rules, is essential for reliable federation.

Exam trap

The trap here is focusing on database configuration or catalog refresh, when the underlying issue is network connectivity between the Databricks cluster and the external database.

Page 1

Page 2 of 4

Page 3

All pages