Databricks · Free Practice Questions · Last reviewed May 2026
60real exam-style questions organised by domain, each with the correct answer highlighted and a plain-English explanation of why it's right — and why the others are wrong.
Refer to the exhibit. You are using Auto Loader to ingest data with evolving schemas. After running the job for a week, you realize that new columns added to the source JSON are not being captured in the destination table. What must you add to the configuration?
Add 'cloudFiles.schemaEvolutionMode': 'rescue'.
Add 'cloudFiles.schemaEvolutionMode': 'addCol'.
Setting schema evolution mode to 'addCol' enables the ingestion process to detect new columns in the source data and automatically add them to the target Delta table. This ensures the table structure remains synchronized with the incoming data stream, preventing the loss of new attributes arriving in source files.
Add 'cloudFiles.maxFiles': '1000'.
Add 'cloudFiles.allowOverwrites': 'true'.
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?
Use the 'partitionColumn' parameter with a random UUID.
Perform a full overwrite of the Delta table for every load.
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.
Enable streaming ingestion using the JDBC source readStream API.
Use the 'fetchSize' parameter to optimize the load.
Your organization is ingesting sensitive PII data. You need to ensure that personal identifiers are masked during the ingestion process before they are stored in the Bronze layer of your Medallion architecture. What is the best practice for this?
Mask the data using Delta Lake column masking after the data reaches the Silver layer.
Apply masking logic within the initial streaming ingestion transformation.
Applying masking logic during the initial ingestion transformation (e.g., using withColumn and sha2 or similar functions) ensures that PII is protected before it is ever committed to storage. This maintains data privacy from the moment the data enters the ecosystem, preventing sensitive information from ever reaching the persistent Bronze table.
Configure Unity Catalog to mask columns only for specific users.
Use a post-ingestion job to delete PII columns.
Which TWO of the following are primary benefits of using Delta Live Tables (DLT) for data ingestion over standard Structured Streaming pipelines?
DLT supports significantly higher throughput than Structured Streaming.
Declarative pipeline management and automated dependency handling.
DLT allows you to define the pipeline in a declarative way, where the system automatically manages the creation and execution of the Directed Acyclic Graph (DAG) of dependencies. This eliminates the manual effort of coordinating complex streams, reducing operational overhead and the likelihood of human error in pipeline configuration.
Built-in data quality monitoring with Expectations.
DLT provides a native 'Expectations' framework that allows you to define quality constraints directly in your code. This enables automatic logging and alerting for data quality issues during ingestion, ensuring that bad data is handled according to business rules without needing custom, complex validation logic in your pipeline.
DLT is the only way to read from cloud object storage.
DLT supports non-Delta storage formats for all outputs.
When ingesting data using Auto Loader, what is the purpose of the 'cloudFiles.schemaLocation' parameter?
It specifies the target directory where the processed Delta table data is stored.
It stores metadata about the inferred schema and tracks evolution.
The schema location is where Auto Loader saves the inferred schema and tracks historical changes. This allows the process to maintain state regarding the data structure, ensuring that subsequent batches are processed correctly even as the source schema changes over time across multiple runs or restarts.
It defines the temporary directory used for shuffling large datasets during joins.
It is used to cache the raw JSON files before they are parsed.
Which THREE of the following are essential components of an effective ingestion monitoring strategy in Databricks?
Monitoring the total number of files in the cloud storage bucket.
Tracking the 'numInputRows' metric in the streaming query progress.
This metric tells you how many records are being processed in each micro-batch. It is essential for detecting data spikes, identifying potential ingestion lags, and verifying that the volume of data flowing through the pipeline aligns with the expected source throughput, which helps in capacity planning and performance tuning.
Setting up alerts on failed expectations in DLT.
Expectations are the primary mechanism for detecting bad data. If a pipeline is running but data is being dropped or failing quality checks, you need immediate notification. Alerting on these failures ensures that data quality issues are addressed before they propagate to Silver or Gold tables, maintaining overall pipeline integrity.
Using DLT event logs to analyze pipeline execution details.
The DLT event log is a comprehensive source of truth for the health, progress, and performance of your pipelines. It contains metadata about every update, failure, and quality check result. Analyzing this data is the industry standard for troubleshooting and auditing production data pipelines in Databricks environments.
Regularly restarting the cluster to clear cache.
Want more Data Ingestion and Acquisition practice?
Practice this domainA data engineer needs to restrict access to personally identifiable information (PII) columns in a Unity Catalog table for a group of analysts. Which Unity Catalog feature should be used to enforce this policy while ensuring data remains queryable?
Apply a static mask using a custom UDF during data ingestion.
Grant the analyst group SELECT access on the table and instruct them to cast PII columns to null.
Define a column mask using SQL functions to redact data for the analyst group.
Unity Catalog column masking allows engineers to apply granular security policies directly to table columns. By defining a mask, the platform automatically redacts data based on the user's role at query time, ensuring compliance without modifying the underlying storage. This provides a clean separation between data storage and security enforcement.
Create separate physical tables for analysts containing only non-sensitive columns.
Which TWO of the following are primary benefits of using Unity Catalog for managing data lineage in Databricks?
It provides automated, column-level lineage tracking for SQL and Python workloads.
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.
It forces all data to be stored in a single, centrally managed S3 bucket.
It enables visibility into dependencies between datasets across different workspaces.
Because Unity Catalog is a multi-workspace governance solution, it provides a centralized view of data dependencies regardless of where the compute occurs. This cross-workspace visibility is essential for enterprise governance, allowing administrators to understand the impact of schema changes or data deletion across the entire organization's data ecosystem.
It automatically encrypts all data at rest using customer-managed keys.
It allows users to manually edit the lineage graph to include external data sources.
Which THREE actions are required to properly implement a secure data sharing strategy using Delta Sharing?
Create a SHARE object containing the tables to be shared.
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.
Configure a RECIPIENT object representing the external partner.
The RECIPIENT object identifies the external entity allowed to access the shared data. This object is critical for the authentication process, as it generates the unique credentials required by the recipient to establish a secure connection and retrieve the data, ensuring that only authenticated parties can consume the shared information.
Grant the recipient access to the underlying S3 bucket directly.
Execute a GRANT SHARE command to link the SHARE and RECIPIENT objects.
The grant command is the final step in establishing the relationship between the data bundle and the recipient. It effectively authorizes the external party to access the contents of the share, allowing them to start querying the data through the Delta Sharing protocol with the provided authentication token.
Copy the data to a public-facing S3 bucket for easier access.
A data engineer wants to ensure that all data in a specific catalog is encrypted at rest. Which feature should they verify is enabled within the Unity Catalog metastore configuration?
Workspace-level access control lists.
Customer-managed keys (CMK) for managed storage.
Customer-managed keys provide a mechanism to encrypt data at rest using keys managed by the customer. This is the industry-standard approach for ensuring data confidentiality in a multi-tenant cloud environment, providing an additional layer of security and auditability that is essential for enterprise compliance and robust data governance.
Unity Catalog lineage tracking.
Table access control (TAC).
An organization needs to share a dataset with a client who does not use Databricks. What is the most efficient and secure way to share this data using Unity Catalog?
Export the data to CSV and upload it to a public FTP server.
Use Delta Sharing with an open sharing provider.
Delta Sharing is the industry-standard, secure protocol for data sharing. It supports both Databricks and non-Databricks recipients, allowing for seamless integration. Because it works at the protocol level, it avoids the security risks of copying data and ensures that the provider retains full control over the shared assets.
Grant the client read-only access to a dedicated Databricks workspace.
Create a public API endpoint that queries the table for the client.
Which TWO of the following are true regarding Unity Catalog's ability to govern external locations?
External locations require a storage credential to function.
A storage credential acts as a bridge between Unity Catalog and the cloud storage provider. Without it, Unity Catalog would have no way to authenticate and access the files in the storage account on behalf of the user, making it impossible to manage external tables securely within the metastore.
Users can directly mount external locations as DBFS paths.
Access to external locations can be granted to users using GRANT statements.
Unity Catalog allows administrators to use the GRANT command to authorize specific users or groups to read or write to an external location. This declarative security model is key to modern governance, as it makes access management programmatic and auditable, aligning with the overall goal of centralized control and security.
External locations are automatically created for every S3 bucket in the account.
External locations are only supported for Delta-formatted data.
Want more Data Governance practice?
Practice this domainA Data Engineer needs to monitor the health of a Delta Live Tables (DLT) pipeline. Which metric should they monitor to track the number of data quality violations over time?
pipeline_latency_seconds
expectations_violated_records
This metric exposes the number of records that failed a quality expectation constraint during the execution of a DLT pipeline. Tracking this count allows engineers to identify data drift or schema issues, enabling proactive remediation and ensuring that final tables meet established business quality standards.
cluster_cpu_utilization
task_retry_count
Refer to the exhibit. An engineer created this alert for a query. Under what condition will the alert status change to 'Triggered'?
When the query returns a row count greater than 3600.
When the 'duration' column value in the query output is strictly greater than 3600.
The 'op' field is set to '>', and the column is 'duration' with a threshold of '3600'. Therefore, any value exceeding 3600 returned by the query result set will satisfy the condition and transition the alert to the 'Triggered' state.
When the query execution takes longer than 3600 seconds to run.
When the query fails and returns an error code equal to 3600.
Which Databricks feature should be used to gain observability into access patterns and security events across the entire workspace?
Delta Live Tables (DLT) logs
Job run history
System tables (Audit logs)
System tables store audit records for all user and system activities in the Databricks environment. They are the authoritative source for monitoring access patterns, ensuring compliance with security requirements, and identifying potential anomalies or security incidents across the entire Databricks workspace ecosystem.
Cluster event logs
A Data Engineer wants to monitor cluster health proactively. Which metric is most effective for identifying that a cluster needs to be scaled up to handle increasing workload demands?
Query result set size
Cluster CPU utilization
High CPU utilization is a direct indicator of compute saturation. When worker nodes sustain high CPU loads, processing throughput drops, leading to job latency. Monitoring this metric allows for the implementation of auto-scaling policies to add nodes, effectively balancing the workload across a larger compute resource pool.
Delta table file count
User login frequency
Which action allows a Data Engineer to receive a Slack notification when a Delta Live Tables pipeline finishes successfully?
Configure a SQL Alert to watch the system metadata tables.
Use the 'Notifications' setting in the DLT pipeline configuration.
DLT pipelines include a dedicated notifications section in the settings. By configuring a destination—such as a webhook URL—engineers can receive automated notifications for pipeline events, including successful completions or failures, ensuring seamless integration with communication tools like Slack or Microsoft Teams.
Create a Python script that polls the Jobs API every minute.
Add a post-pipeline task that sends an email to the Slack email gateway.
When troubleshooting a job that frequently crashes due to 'Out of Memory' (OOM) errors, which TWO metrics or logs should be analyzed?
Driver and Executor logs.
Driver and executor logs contain the stack traces and error messages that specifically indicate memory exhaustion. Reviewing these logs allows the engineer to determine whether the error occurred during a shuffle operation, a broadcast join, or while loading a large data partition into memory.
System table audit logs.
Spark UI Executor memory metrics.
The Spark UI provides real-time visualization of memory usage across all executors. Monitoring how memory is consumed during specific stages helps pinpoint if a memory-intensive transformation or a skew issue is the root cause of the crashes, enabling targeted code optimizations or configuration adjustments.
Workspace usage billing reports.
The number of active sessions in the SQL warehouse.
Want more Monitoring and Alerting practice?
Practice this domainA 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?
Configure the downstream task to use the 'depends_on' attribute to reference the upstream task ID.
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.
Set the task timeout to zero to prevent the workflow from ever stopping during a failure.
Enable the 'repair and rerun' feature to target only the failed tasks in the pipeline.
The repair and rerun feature allows engineers to execute only the failed tasks and their downstream dependents. This preserves the existing successful outputs of the workflow and ensures that the system only attempts to process data that was previously blocked by the specific task failure event.
Hardcode the file path of the upstream output into the downstream task configuration.
Disable all retries to ensure that the error log is captured immediately upon failure.
Refer to the exhibit. A data engineer is deploying a production pipeline that references a table in the default schema. The job fails with the provided error. What is the root cause?
The cluster is running an outdated version of the Spark runtime.
The job is running under a service principal that lacks permissions to the Hive Metastore.
The table exists only in the temporary session catalog of a different notebook.
Temporary views or tables created in interactive notebook sessions are not persisted in the shared Hive Metastore and are scoped to the session. Since the job runs in a separate, isolated environment, it cannot access objects defined in the transient memory of a different interactive session.
The cluster has insufficient memory to load the table metadata.
A data engineer is automating the deployment of Databricks assets using CI/CD. The pipeline fails because the 'databricks-cli' command cannot find the workspace. What is the most likely cause?
The Databricks CLI version on the build agent is incompatible with the server.
The runner does not have the DATABRICKS_HOST and DATABRICKS_TOKEN environment variables set.
The Databricks CLI looks for these specific environment variables to authenticate with the workspace. If they are absent, the CLI cannot establish a connection, leading to an error indicating that it cannot reach or find the workspace. This is the most common cause of failures in automated pipelines.
The workspace API is currently disabled for security reasons.
The CI/CD runner is missing the required library dependencies like PySpark.
You are monitoring a long-running Databricks job. You notice that the memory usage on the driver node is steadily increasing until it crashes. Which debugging action is most appropriate?
Increase the number of worker nodes in the cluster.
Use the Spark UI to identify tasks using 'collect()' or 'toPandas()' on large datasets.
The Spark UI allows you to inspect the execution plan and identify operations that move data from worker nodes to the driver node. Using 'collect()' on large datasets is a classic cause of driver out-of-memory errors. Identifying these bottlenecks allows you to replace them with distributed data writing.
Update the cluster's Spark configuration to disable the driver's log monitoring.
Lower the 'spark.driver.maxResultSize' setting in the cluster configuration.
Which THREE strategies should a data engineer use to optimize the debugging of failed production Databricks Jobs?
Implement structured logging within the application code to track variable states.
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.
Grant all developers full cluster permissions to access logs directly on the nodes.
Modularize code into libraries (wheels) to enable easier unit testing and local debugging.
Moving logic into modular wheels allows developers to write unit tests and debug code in a local IDE before deployment. This isolates business logic from the Databricks environment, enabling faster iteration and higher code quality, which prevents many bugs from ever reaching the production environment in the first place.
Configure alerts on job failures to send notifications to a team Slack or email channel.
Alerting is essential for immediate awareness of failures. By integrating Databricks job monitoring with communication platforms, the team is notified immediately when a job fails, ensuring that the investigation process starts as soon as possible, thereby minimizing the impact of the failure on data availability and business processes.
Run all production jobs as the root user to avoid permission-related errors.
Where can a data engineer find the standard output and error logs for a specific task within a Databricks Workflow?
In the Databricks Filesystem (DBFS) root directory under /logs.
By clicking the 'Logs' tab within the specific task run details in the Jobs UI.
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.
By querying the 'sys.logs' table in the Unity Catalog.
In the cluster configuration's 'Advanced Options' tab.
Want more Debugging and Deploying practice?
Practice this domainA Data Engineer needs to ensure that PII data in a Delta table is accessible only to members of the 'hr_admin' group, while allowing all other users to view the non-PII columns. Which Unity Catalog feature is the most efficient way to implement this requirement?
Create separate physical tables for HR and general users.
Use standard SQL views for every user to filter columns.
Apply a column mask using a SQL function in Unity Catalog.
Column masking in Unity Catalog allows administrators to define functions that dynamically redact or obscure data based on the user's role. This provides a unified, policy-driven approach to data security that is applied at query time, ensuring compliance without the complexity of managing numerous views or physical tables.
Assign the 'SELECT' permission on individual columns in the UI.
An organization is migrating to Unity Catalog and needs to secure sensitive data. Which TWO of the following statements regarding Unity Catalog security best practices are correct?
Assign table ownership to individual users for better tracking.
Use groups instead of individual users for access grants.
Granting permissions to groups rather than individual users simplifies access management and reduces the risk of human error. When a new user joins a team, they automatically inherit the correct permissions by being added to the relevant group, ensuring consistent security posture across the entire data platform.
Ensure that the metastore admin has access to all data.
Use Service Principals for automated CI/CD job execution.
Service principals are the ideal identity for automated processes and CI/CD pipelines. They provide a secure, non-interactive way to manage data access without relying on individual user credentials, which expire and pose security risks. This ensures that pipelines maintain consistent access even when team members change.
Public access should be granted to the root catalog.
A Data Engineer needs to encrypt data at rest within a Databricks workspace that uses a customer-managed key (CMK). What is the primary purpose of this configuration?
To increase the read throughput of Delta tables.
To enable transient data encryption for cluster nodes.
To control the lifecycle of the encryption keys used for storage.
The primary purpose of CMK is to allow the organization to manage the lifecycle of encryption keys. This includes rotation policies and the ability to immediately revoke access to the storage account, ensuring that the cloud provider cannot access the data without the customer's active cooperation.
To bypass the need for Unity Catalog permissions.
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?
Unity Catalog access controls.
IP Access Lists.
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.
Cluster-level Spark configurations.
Workspace-level SSO integration.
What is the primary function of a 'Personal Access Token' (PAT) in Databricks, and why is it considered a security risk if not managed properly?
It allows users to bypass multi-factor authentication.
It is intended for end-user dashboard access.
It provides long-lived programmatic access to the API.
PATs provide a mechanism for scripts to authenticate with Databricks without interactive logins. Because they are long-lived, if they are hardcoded in scripts or exposed in logs, they provide an attacker with persistent access to the user's workspace, creating a significant security vulnerability if not rotated regularly.
It encrypts data stored in the workspace.
Which of the following describes the correct behavior of Unity Catalog's 'Data Lineage' when used for security compliance?
It shows which users accessed the data.
It captures table-to-table data dependencies.
Unity Catalog lineage maps dependencies between tables, including views and downstream transformations. This is essential for compliance, as it allows engineers to see the flow of sensitive data through the ETL pipeline, making it easier to ensure that masking policies are applied to all downstream, derived datasets.
It manually triggers an alert when PII is detected.
It permanently stores the raw data content.
Want more Data Security and Compliance practice?
Practice this domainA Data Engineer needs to share a Delta table with a partner organization using Delta Sharing. The partner does not use Databricks. Which component must the Data Engineer generate to facilitate this secure connection?
A shared Unity Catalog metastore link
A personal access token with REST API permissions
A sharing credential file
The sharing credential file is the fundamental mechanism for Delta Sharing. It contains the short-lived access token and the endpoint URL required by the external client to authenticate and authorize requests. This file acts as the bridge between the provider's data and the recipient's consumption tool, ensuring secure access.
A cross-account IAM role in the recipient's cloud
Which statement correctly describes the relationship between Unity Catalog and Databricks SQL Warehouses when using Lakehouse Federation?
The SQL Warehouse performs the data ingestion into the Unity Catalog metastore.
The SQL Warehouse pushes down query predicates to the external database.
A key benefit of Lakehouse Federation is query pushdown. The SQL Warehouse optimizes the execution plan by sending filters, aggregations, and joins to the external database engine. This reduces data movement across the network and leverages the external database's compute power, significantly improving query performance for federated sources.
Unity Catalog must store the external data in a managed Delta table.
All federated queries are executed solely within the Databricks control plane.
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?
Create a connection object with appropriate credentials in Unity Catalog.
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.
Ingest all PostgreSQL data into a S3 bucket first.
Create a foreign catalog that references the PostgreSQL connection.
A foreign catalog acts as the entry point for the external data within Unity Catalog. It links the connection object to the specific remote database, allowing users to navigate and query the external schema as if it were part of the local Unity Catalog metadata hierarchy for seamless access.
Install a custom JDBC driver on every user's local machine.
Configure a VPC peering connection to the external database.
What is the primary difference between sharing data via Delta Sharing compared to sharing data via Databricks-to-Databricks sharing?
Delta Sharing is only for real-time streaming data.
Databricks-to-Databricks sharing requires the recipient to download a credential file.
Delta Sharing allows recipients outside of the Databricks ecosystem to access data.
Delta Sharing is an open-source protocol that decouples the data provider from the recipient's environment. This enables organizations to share data securely with partners who may be using different cloud providers or query engines, as long as they can consume the open Delta Sharing protocol via a credential file.
Databricks-to-Databricks sharing is limited to within the same cloud region.
What is the primary benefit of using Unity Catalog for data federation?
It eliminates the need for any network configuration.
It provides a single security model for all data sources.
Unity Catalog abstracts the security differences between various data sources. Whether you are querying a PostgreSQL database, a Snowflake instance, or internal Delta tables, you use the same Unity Catalog permission syntax. This dramatically reduces the administrative overhead and potential for configuration errors across a complex multi-source data landscape.
It automatically converts all external data to Delta format.
It allows the SQL Warehouse to run entirely on the external database.
When using Delta Sharing to share data with a recipient, what is the best way to handle updates to the shared data?
The provider must recreate the share object.
The recipient must request a new credential file.
Updates are automatically visible to the recipient.
Because Delta Sharing queries the live Delta table, the recipient always sees the most recent committed state of the data. This provides a seamless, real-time data sharing experience, eliminating the manual overhead of exporting files or synchronizing data snapshots between the provider and the recipient organizations.
The provider must run an 'REFRESH SHARE' command.
Want more Data Sharing and Federation practice?
Practice this domainYou 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?
Increase the spark.sql.shuffle.partitions configuration dynamically.
Broadcast the skewed table to all executors.
Salt the skewed column and perform the join.
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.
Cache the skewed table in memory before the join.
You are processing sensitive PII data in a Delta table. You need to ensure that specific columns containing PII are not readable by general data analysts while maintaining the ability to perform aggregate analysis on those rows. Which feature should you implement?
Use the 'ALTER TABLE DROP COLUMN' command.
Apply Dynamic Views with functions like 'mask_hash' or 'case'.
Dynamic Views allow the definition of access policies based on the session user's role or identity. By using functions such as masking or conditional logic, you can obscure PII for unauthorized users while keeping the underlying data intact for administrative roles or authorized analytical processes as required.
Implement row-level security using Spark configurations.
Encrypt the entire storage bucket using cloud-native tools.
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?
Columns with high cardinality are generally better candidates.
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.
You should Z-Order on every column to maximize performance.
Z-Ordering should be applied to columns frequently used in WHERE clauses.
The primary benefit of Z-Ordering is to accelerate range queries and point lookups. Columns used in WHERE clauses are the most common candidates because the engine can use the Z-Index to quickly prune files, resulting in significantly fewer files being scanned during the execution of the query.
Z-Ordering is most effective on columns that are never filtered.
Z-Ordering significantly improves performance for joins on the indexed column.
When join keys are Z-Ordered, the physical layout of the data may align with the join distribution, potentially reducing the amount of data shuffled across the network. This can lead to faster join performance, especially when joining two large tables that have been optimized with similar clustering strategies.
You are migrating a legacy ETL process to Delta Live Tables (DLT). You have an existing table defined with a complex transformation that involves a custom Python function using a third-party library. How should you structure this in DLT to ensure the function is available and correctly applied?
Define the function inside the same notebook but outside the 'dlt.table' function.
Defining the function in the same module ensures it is accessible during the execution of the DLT pipeline. The decorator will register the function as part of the materialization process, allowing DLT to call it while processing data, provided that any necessary external libraries are also installed.
Hardcode the library path using 'sys.path.append'.
You cannot use custom Python functions in DLT.
Use the 'spark.udf.register' method globally.
When designing a streaming pipeline using Structured Streaming, which THREE of the following are necessary to ensure 'exactly-once' processing semantics in Databricks?
Using a source system that supports replaying data (e.g., Kafka or Delta).
Exactly-once requires the ability to re-read the stream from a specific offset if a failure occurs. Kafka and Delta provide the necessary offset management to ensure that data can be re-processed accurately after a system interruption, which is the foundational requirement for guaranteeing consistent results in streaming pipelines.
Writing to the sink using an idempotent operation.
Idempotency ensures that multiple attempts to write the same data result in the same final state in the destination. This is crucial for handling retries that occur during a failure; without idempotency, a retry could lead to duplicate rows, violating the exactly-once processing guarantee required by many downstream systems.
Setting 'spark.sql.shuffle.partitions' to 1.
Maintaining a checkpoint directory in a reliable storage location.
The checkpoint directory stores the state and metadata of the streaming query. If the query fails, it uses this information to recover from the exact point of failure. This mechanism is mandatory for maintaining the state across failures and ensuring that progress tracking remains consistent throughout the pipeline lifecycle.
Disabling the Delta Lake write-ahead log.
You have a large Spark DataFrame that you need to filter and save as multiple smaller Parquet files based on the values in a 'region' column. Which method should you use to optimize the file layout for subsequent queries?
Use the 'repartition' method on the DataFrame before writing.
Use the 'partitionBy' option in the write command.
The 'partitionBy' command instructs Spark to organize the output into a directory structure based on the values in the specified columns. This allows downstream queries to use partition pruning to only scan the necessary folders, significantly reducing data read and increasing query efficiency for the region data.
Use the 'sortWithinPartitions' method.
Use the 'coalesce' method.
Want more Developing Code (Python/SQL) practice?
Practice this domainA Data Engineer needs to enforce a NOT NULL constraint on a specific column in a Delta table while maintaining the ability to perform high-performance streaming writes. Which approach is the most efficient and native method to ensure this data quality requirement?
Apply a filter transformation in the DataFrame after the data is written to the table.
Use an external Delta Live Tables expectation to quarantine bad records.
Add a CHECK constraint to the table using the ALTER TABLE ADD CONSTRAINT command.
The ALTER TABLE ADD CONSTRAINT command natively integrates with Delta Lake's transaction log to enforce validation at the moment of ingestion. It is highly performant and ensures that no transaction containing a null value in the specified column will be committed, effectively preventing data quality issues at the source.
Perform a manual check within the Spark Structured Streaming loop before appending to the sink.
Refer to the exhibit. A Data Engineer is attempting to merge data into a table with these constraints defined. If the incoming batch contains rows that violate these rules, what is the default behavior of the Delta Lake engine during the merge operation?
The engine silently ignores the invalid rows and completes the merge for valid records only.
The transaction fails entirely, and no changes are committed to the Delta table.
Constraints in Delta Lake are hard requirements. If an operation violates these rules, the commit fails, and the transaction is aborted. This guarantees that the table remains in a consistent state and prevents invalid data from entering the storage layer, which is crucial for maintaining reliable audit trails and reports.
The invalid rows are automatically routed to a hidden sidecar table for later review.
The engine automatically updates the invalid rows to the default column value.
You are migrating a legacy CSV-based ETL process to Databricks. The source CSV files contain inconsistent date formats. Which approach provides the most scalable way to handle these inconsistencies during the bronze-to-silver transformation?
Convert all columns to string type to avoid parsing errors, and handle formatting in the visualization tool.
Use the 'from_unixtime' function with a hardcoded string format for all records.
Use the 'to_timestamp' function with an array of acceptable formats to parse the column.
The 'to_timestamp' function in Spark SQL accepts a format string or an array of formats. This allows the engine to attempt parsing against multiple patterns, which is the most robust and performant way to handle format inconsistencies without writing complex, slow-running row-based logic or custom UDFs.
Delete all rows with invalid date formats using a 'drop' expectation in a DLT pipeline.
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?
Use a standard SQL DELETE query with a subquery to identify and remove duplicates.
Use the dropDuplicates() method with watermark settings to manage state.
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.
Set the table property 'delta.enableChangeDataFeed' to true and filter on the change log.
Increase the 'spark.sql.shuffle.partitions' setting to ensure all duplicates land on the same node.
A Data Engineer is implementing a medallion architecture. Which THREE steps are critical for effectively implementing a high-quality 'Silver' layer from 'Bronze' data?
Enforce strict schema validation on incoming Bronze files.
Schema enforcement at the Silver layer is critical to ensure data consistency. By validating that columns match expected types and structures, you prevent downstream failures in analytical queries and reporting tools, which often lack the robustness to handle unexpected schema changes or malformed data types automatically.
Perform deduplication to ensure unique records based on business keys.
Data quality at the Silver level requires uniqueness. Deduplication ensures that metrics are calculated based on accurate counts and that analytical models are not biased by repeated data points. This is foundational for providing reliable business insights and avoiding costly mistakes in decision-making based on inflated or incorrect datasets.
Apply business logic and complex transformations to create aggregate summary tables.
Convert all column names to uppercase to ensure case-insensitive consistency.
Standardize data formats (e.g., timestamps, currency codes) across all source systems.
Standardization is crucial for cross-system analysis. By normalizing formats like date/time and currency in the Silver layer, you enable joining and comparing data from disparate sources, which is the primary purpose of the Silver layer: creating a unified, trustworthy dataset that serves as the foundation for downstream analytical workloads.
You are tasked with handling PII (Personally Identifiable Information) in your data pipeline. Which approach is best for protecting this data while maintaining the ability to perform analytics?
Simply drop the PII columns during the Bronze-to-Silver transformation.
Encrypt the PII data using a shared key stored in the pipeline code.
Hash the PII columns using a salted, non-reversible cryptographic hash function.
Hashing with a salt provides a secure, non-reversible way to mask PII while maintaining referential integrity. This allows analysts to group data by the hash key without seeing the actual sensitive values. It is a highly recommended practice for balancing data utility with strict regulatory and privacy requirements.
Use a public, non-salted MD5 hash function to ensure consistency across teams.
Want more Data Transformation, Cleansing, Quality practice?
Practice this domainRefer to the exhibit. An engineer observes that queries filtering on 'customer_id' are running slowly despite Z-Ordering. What is the most likely cause?
The partition columns should include 'customer_id' to improve the pruning speed.
Z-Ordering must be performed on the partition columns instead of the join columns.
The queries lack filters on 'region' or 'date', preventing effective partition pruning.
Because the table is partitioned by region and date, failing to include these in the WHERE clause forces the engine to scan every partition. Z-Ordering only clusters data within individual partitions. If the engine doesn't prune the partitions first, the Z-Ordering benefits are largely ignored during the scan.
The file format should be changed to Parquet to improve individual file read performance.
In the medallion architecture, which layer is primarily responsible for applying business logic and historical aggregations?
The Bronze layer acts as the primary layer for historical aggregation and business logic.
The Silver layer is designed for applying complex business logic and final aggregations.
The Gold layer is designed for applying business logic and historical aggregations.
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.
The Raw layer stores all business logic results for future auditing.
A company requires data to be physically deleted from the Bronze layer for GDPR compliance. What is the correct procedure to ensure complete removal?
Simply run the DELETE statement; Delta handles physical deletion automatically.
Run the DELETE statement and then run the VACUUM command.
The DELETE command updates the Delta log to exclude the records from future reads. Running VACUUM removes the orphaned files that contain the deleted data. This combination ensures the records are both logically and physically removed from the data lake, fulfilling the legal requirements of GDPR compliance.
Use the OPTIMIZE command to force the deletion of the records.
Overwriting the table with a filtered subset using the OVERWRITE option.
Which design pattern is best suited for handling late-arriving data in a medallion architecture?
Discard all late-arriving records to ensure a clean source-of-truth.
Update the Silver layer using a MERGE operation that matches on event time.
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.
Append late-arriving data to the Bronze layer but ignore it in all downstream layers.
Create a separate 'late_data' table and join it to the main table every month.
What is the primary benefit of the Medallion architecture in a Databricks Lakehouse?
It eliminates the need for data partitioning and Z-Ordering.
It provides a clear progression of data quality and structure.
The medallion architecture organizes data into Bronze, Silver, and Gold to represent increasing levels of refinement. This structured approach allows teams to manage data quality incrementally, ensures that business logic is applied consistently, and provides an immutable raw history that can be reprocessed whenever requirements change.
It forces all data to be stored in a star schema at all layers.
It automatically converts all incoming data to a structured format.
Which of the following describes the purpose of the 'Gold' layer in a Lakehouse?
To store the raw data in an immutable format for historical auditing.
To serve as a staging area for data cleaning and filtering.
To store business-ready data for analytical use cases.
The Gold layer provides final, aggregated datasets that are ready for BI and reporting. By presenting data in this format, it masks the underlying complexity of the raw and silver data, providing a performant and understandable view of the business to end-users and non-technical stakeholders.
To store only metadata for the entire Lakehouse architecture.
Want more Data Modelling practice?
Practice this domainA data engineer is tasked with reducing compute costs for an interactive SQL analytics workspace that runs sporadic, highly unpredictable queries. The jobs experience cold start delays and occasional out-of-memory errors due to sudden concurrency spikes. Which TWO strategies should the engineer implement to balance cost efficiency and performance?
Configure single-node clusters with maximum autoscaling limits to handle unpredictable concurrency peaks without cluster management overhead.
Migrate interactive SQL workloads to Databricks Serverless Compute to dynamically scale resources and eliminate idle billing.
Serverless SQL warehouses scale automatically with query concurrency and bill only while active, directly addressing the sporadic, unpredictable workload and idle-cost constraint. Cold starts and out-of-memory errors from concurrency spikes are absorbed by dynamic resource provisioning rather than fixed cluster sizing.
Provision pools of pre-warmed idle driver nodes to ensure zero-second startup latency for all analytical queries.
Enable Photon acceleration on clusters executing heavy relational scans and complex analytical joins.
Photon uses a vectorized execution engine written in C++ to optimize CPU cache utilization and memory bandwidth, significantly accelerating scan and join heavy workloads. Faster execution directly translates to lower compute costs on standard multi-node clusters.
Disable automatic cluster termination and keep all worker nodes running 24/7 to guarantee immediate resource availability.
A data engineer is designing an ETL pipeline processing high-frequency streaming data into Delta tables on Databricks. The pipeline experiences frequent small file creation and high metadata overhead, degrading query performance. Which optimization technique should the engineer implement to resolve this issue?
Increase the Delta table version retention period to keep historic snapshots longer.
Enable predictive optimization to automatically manage compaction and vacuum operations.
Enable spark.databricks.delta.optimizeWrite.enabled and spark.databricks.delta.autoCompact.enabled.
Enabling optimized writes and Auto Compact forces Spark to shuffle data to achieve well-sized files prior to writing and automatically triggers a compaction pass when small files are detected. This directly targets the root cause of metadata bottlenecks in high-frequency streaming architectures.
Switch the table format from Delta to Apache Parquet to leverage native cloud storage indexing.
An enterprise data team runs a large nightly batch job using a standard all-purpose cluster. The job frequently fails due to cloud provider spot instance pre-emptions and takes over four hours to complete. How should the engineer refactor this architecture for maximum cost efficiency and reliability?
Provision a larger all-purpose cluster with double the worker nodes to brute-force execution speed.
Convert the workload to use a Databricks Job cluster configured with spot instances and automatic fallback to on-demand.
Job clusters are cheaper than all-purpose clusters and terminate after the run. Configuring spot instances with automatic fallback to on-demand preserves cost savings while surviving pre-emptions, directly addressing the reliability failure and the four-hour runtime.
Upgrade the cloud provider virtual machine family to the latest generation without changing cluster types.
Increase the Apache Spark executor memory fraction and decrease shuffle partition counts.
Refer to the exhibit. A data engineer creates an instance pool to reduce cluster startup times for development teams. However, finance reports indicate unexpected cloud infrastructure charges. Based on the configuration shown in the exhibit, what is the primary driver of these unexpected costs?
The max_capacity limit is set too low, forcing teams to provision multiple competing instance pools.
Instance pools do not support Spot instances, forcing all pool-backed clusters to run expensive on-demand VMs.
The min_idle_instances setting maintains running virtual machines continuously, incurring persistent infrastructure costs.
min_idle_instances keeps that number of virtual machines powered on at all times, even when no clusters are running. Those idle instances bill continuously for cloud infrastructure, which is the persistent cost driver behind the unexpected charges shown in the exhibit.
The selected node_type_id is optimized for storage rather than compute, causing inflated licensing surcharges.
A data engineer is optimizing a Delta Lake table that experiences high read latency due to many small files. Which command should be executed to physically reorganize the data layout to improve query performance?
VACUUM table_name
ANALYZE TABLE table_name COMPUTE STATISTICS
OPTIMIZE table_name
OPTIMIZE triggers a compaction process that aggregates small files into larger, optimized Parquet files. This process significantly improves read performance by enabling better data skipping and reducing the overhead associated with listing and opening numerous tiny files, which is a common bottleneck in high-frequency Delta Lake write workloads.
REORG TABLE table_name APPLY (PURGE)
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?
Set the auto-stop duration to a very low value, such as 1 minute, for serverless SQL warehouses.
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.
Enable multi-cluster load balancing to ensure all queries are executed on the largest instance type.
Configure SQL warehouse scaling to use the maximum cluster size at all times to avoid resizing overhead.
Implement SQL query history monitoring to identify and optimize long-running or resource-intensive queries.
Identifying expensive queries through the query history allows engineers to optimize code, improve filter usage, or adjust data partitioning. By reducing the total compute time required for these heavy jobs, the warehouse consumes fewer resources, enabling shorter auto-stop timers and lowering overall operational costs for the Databricks SQL environment.
Disable the query cache to ensure all results are freshly computed for accurate billing metrics.
Want more Cost and Performance Optimization practice?
Practice this domainThe Databricks-DE-Pro exam has 60–90 questions and must be completed in 120 minutes. The passing score is 700/1000.
Scenario-based questions covering exam objectives with detailed answer explanations.
The exam covers 10 domains: Data Ingestion and Acquisition, Data Governance, Monitoring and Alerting, Debugging and Deploying, Data Security and Compliance, Data Sharing and Federation, Developing Code (Python/SQL), Data Transformation, Cleansing, Quality, Data Modelling, Cost and Performance Optimization. Questions are weighted by domain — higher-weight domains appear more on your actual exam.
No. These are original exam-style practice questions written against the official Databricks Databricks-DE-Pro exam objectives. They are not copied from the real exam. Courseiva focuses on genuine understanding, not memorisation of braindumps.
Courseiva tracks your accuracy per domain and routes you toward weak areas automatically. Free, no account required.