A silver-layer SQL transform must retain exactly one latest order record per `order_id` using `updated_at`. Which Spark SQL pattern is the most reliable?
Databricks Engineer Pro Developing Code
Question · Easy
You need to classify rows with a few regex-based rules in PySpark and keep the job optimizable by Catalyst. What should you do?
Question · Medium
Chapter 1: Developing Code for Data Processing using Python and SQL - Core Spark SQL & PySpark
1.1 Complex PySpark Transformations & DataFrame API
Study guide
In Lakeflow Declarative Pipelines, when should a dataset be modeled as a streaming table instead of a materialized view?
Tech Exam Prep Podcast
Listen on Spotify
Podcast
A structured streaming job writes to Delta through `foreachBatch`. The job may be restarted after failures, and duplicate output must be avoided. Which design is best?
Question · Hard
A CDC feed contains operation codes `I`, `U`, and `D`. Which `MERGE` logic is required to correctly apply deletes into a Delta target?
A 20 MB dimension table is joined to a 4 TB fact DataFrame in PySpark. Which approach usually produces the most efficient plan?
1.2 Advanced Spark SQL Patterns
A Lakeflow Declarative Pipelines project has bronze, silver, and gold datasets in one pipeline. How should downstream dependencies be expressed so Databricks can manage refresh order automatically?
You need 15-minute event-time aggregations from a streaming source while limiting state growth and allowing late data up to 2 hours. Which design is correct?
A Spark SQL join must treat two NULL business-key values as equal. Which operator should you use in the join condition?
Your team wants reusable PySpark cleansing steps that can be unit tested and chained cleanly across multiple DataFrames. Which pattern fits best?
1.3 Streaming Workloads with Structured Streaming
A batch transformation needs reference data from a REST API for every product code. Which design is most scalable on Databricks?
You enabled Change Data Feed on a Delta source and want to query only the rows that changed between versions in SQL. Which built-in function should you use?
You need continuous cloud-file ingestion from an object store landing zone, with scalable file discovery and checkpointed progress. Which Databricks feature is designed for this?
Databricks Engineer Pro Data Ingestion
An Auto Loader stream receives JSON files with occasional new fields and unexpected type mismatches. Which behavior best preserves ingestion continuity while surfacing anomalies for review?
1.4 Lakeflow & Delta Live Tables (DLT) Declarative Pipelines
A team wants a managed connector to replicate data from a SaaS application into Databricks without building custom extraction code. Which service is the best fit?
A source database emits out-of-order inserts, updates, and deletes with a monotonically increasing sequence column. Which ingestion pattern best builds a current-state silver table?
Customer state codes arrive as `ca`, `Ca `, `CALIFORNIA`, and blank strings. What is the best silver-layer first step before joining to a state dimension?
Databricks Engineer Pro Transformation Quality
A streaming pipeline must remove duplicate click events keyed by `event_id`, but duplicates can arrive up to 30 minutes late. Which approach should you use?
Chapter 2: Developing Code for Data Processing using Python and SQL - Streaming & Advanced Patterns
2.1 Advanced Delta Lake Features
A Lakeflow Declarative Pipeline should prevent invalid records from landing in the target table but continue processing valid rows. Which expectation behavior should be used?
You are building a customer dimension that must preserve attribute history after each source change. Which pattern best satisfies the requirement?
A silver table combines phone numbers from multiple countries in inconsistent formats. What transformation goal should be prioritized before deduplication?
A streaming deduplication job uses a 24-hour watermark. What does Databricks guarantee about duplicates that arrive more than 24 hours later?
2.2 Custom & Stateful Streaming Operations
Your company needs to provide an external partner read-only access to curated Delta tables without copying the data into the partner's cloud account first. Which Databricks capability is intended for this?
Databricks Engineer Pro Sharing Federation
Analysts need to query operational PostgreSQL data from Databricks using Unity Catalog naming and permission controls, but the data should remain in PostgreSQL. Which design is best?
Across several workspaces, you need historical visibility into job runs, query activity, and billing data for dashboards and trend analysis. Where should you start?
Databricks Engineer Pro Monitoring Alerting
A bronze ingestion pipeline has an SLA that new files must be reflected in downstream tables within 20 minutes. Which metric is most useful to alert on?
2.3 Python & PySpark Code Modularization
A production workflow should notify the on-call channel immediately when retries are exhausted and a task still fails. What is the simplest robust approach?
A structured streaming job's checkpoint directory was accidentally deleted, but the target Delta table must remain correct after recovery. What is the safest restart strategy?
You want to find the slowest pipelines and the most failure-prone jobs over the last 14 days at the account level. Which approach is most appropriate?
A large Delta table is frequently filtered by `customer_id` and `order_date`, and the access pattern changes over time. Which storage layout strategy is generally better than high-cardinality partitioning?
Databricks Engineer Pro Cost Performance
2.4 User-Defined Functions (UDFs) & Performance Impact
A SQL warehouse runs aggregation-heavy analytics on Delta tables. Which engine setting typically improves performance without changing query logic?
A Delta table receives many small batch writes and query latency is rising. Which action most directly addresses the small-file problem?
A join between a very large fact table and a medium dimension table is slow because a small number of keys are massively overrepresented. What is the most targeted mitigation?
A nightly ETL job runs for 20 minutes and is idle the rest of the day. Which compute choice is usually the most cost-efficient?
Chapter 3: Data Ingestion & Acquisition
3.1 Auto Loader (cloudFiles) Production Ingestion
A BI dashboard query scans far more data than necessary from a wide gold table. Which change most directly reduces both cost and latency?
Large `MERGE` statements into a Delta table remain slow even after scaling up compute. The merge predicates align with a small set of business keys. Which improvement is most likely to help?
A team should query a curated customer view but must not access the underlying raw tables directly. In Unity Catalog, what is the least-privilege pattern?
Databricks Engineer Pro Security Compliance
A workflow needs a database password for a JDBC connection. What is the recommended way to manage the credential?
Loading more…