Microsoft Data Engineering with Azure Databricks (DP-750) · 33% practice allocation

Microsoft DP-750: Prepare and process data Practice Questions

5 free sample questions from the Prepare and process data domain, with answers and explanations. The full DP-750 bank has 229 questions across 4 domains. Questions are scenario-based and written from the official Microsoft exam guide.

1.

A data engineer is designing a Unity Catalog Delta table that will be used to answer ad hoc queries filtering on any combination of region, product_category, and event_date. The table will grow to approximately 2 TB and will receive daily batch appends. Query patterns are unpredictable and often combine two or three of these columns in WHERE clauses. Which physical optimization strategy is MOST appropriate?

  • A. Partition the table on region and product_category as composite partition keys.
  • B. Partition the table on event_date and apply Z-order on region and product_category.
  • C. Apply Z-order on all three columns without any partitioning.
  • D. Apply liquid clustering on region, product_category, and event_date.✓ Correct
Explanation

Liquid clustering is the recommended modern approach for multi-dimensional query patterns on large Delta tables in Unity Catalog. It incrementally reorganizes data as new records arrive, avoids over-partitioning pitfalls, and efficiently co-locates data for any combination of the specified clustering columns. Partitioning on event_date plus Z-order is a valid older pattern but requires manual OPTIMIZE runs and Z-order does not colocate data as effectively for highly varied multi-column queries. Composite partitioning on region and product_category would create a very large number of small partitions and does not help with date-based filters. Z-order alone without partitioning on a 2 TB table would make every query scan the entire table before benefiting from data skipping.

2.

A financial services company stores trade records in a Unity Catalog Delta table. The compliance team requires the ability to query the exact state of the table as it existed 72 hours ago without any additional ETL jobs. Which Delta Lake feature satisfies this requirement?

  • A. Delta time travel using the TIMESTAMP AS OF clause to query the table at a past timestamp.✓ Correct
  • B. Deletion vectors, which track row-level deletes and allow historical state reconstruction.
  • C. A Type 2 Slowly Changing Dimension implementation that maintains effective date ranges.
  • D. Delta table clones, which create a snapshot of the table at a specific point in time.
Explanation

Delta time travel with TIMESTAMP AS OF allows querying a Delta table as it existed at any prior timestamp within the retention window (default 30 days), requiring zero additional ETL. This is the native, built-in mechanism for point-in-time reads. Deletion vectors track row-level deletes for performance purposes but do not independently reconstruct historical table states for querying. Delta clones create a copy at a moment in time but must be created proactively before the need arises — you cannot retroactively create a clone 72 hours in the past. An SCD Type 2 approach would work conceptually but requires significant schema and ETL redesign upfront and does not leverage the existing table.

3.

A data engineer is building a Unity Catalog Delta table to store customer orders. The source system performs frequent UPSERTs (inserts and updates) and occasional deletes. The table is currently Z-ordered on customer_id. Query performance on large scans has degraded as the table has grown and accumulated many small files from merge operations. Which action will BEST improve both query performance and write performance going forward?

  • A. Increase the shuffle partitions to reduce small file creation during merge operations.
  • B. Convert the table to use liquid clustering on customer_id, replacing Z-ordering.✓ Correct
  • C. Enable deletion vectors on the table to avoid physical rewriting of files during deletes.
  • D. Run OPTIMIZE with ZORDER BY customer_id on a nightly schedule to compact files and maintain the Z-order.
Explanation

Liquid clustering is the modern replacement for Z-ordering in Delta Lake. It incrementally clusters data as writes occur, eliminating the need for periodic full OPTIMIZE runs to maintain data layout. This directly addresses the file fragmentation caused by frequent merges. Nightly OPTIMIZE with ZORDER is a viable but less efficient approach — it requires manual scheduling and performs a full rewrite of files each run, which is costly. Increasing shuffle partitions affects Spark task parallelism and may slightly influence file sizes but does not address the root cause of clustering degradation. Deletion vectors reduce write amplification for deletes by marking rows as deleted rather than rewriting files, which helps delete performance but does not compact existing small files or improve scan performance for large queries.

4.

A data engineer is designing a pipeline that must pivot monthly sales data so that each month becomes a column (e.g., Jan, Feb, Mar) with the total sales as the value, grouped by product category. The source table has columns: category STRING, month STRING, and sales_amount DOUBLE. Which Spark SQL approach correctly implements this transformation?

  • A. Use SELECT * FROM sales PIVOT (SUM(sales_amount) FOR month IN ('Jan', 'Feb', 'Mar')) to produce one column per month.✓ Correct
  • B. Use a GROUP BY category with SUM(sales_amount) and manually alias each month using CASE WHEN month = 'Jan' THEN sales_amount END for each month.
  • C. Use a window function RANK() OVER (PARTITION BY category ORDER BY month) to assign column positions for each month.
  • D. Use UNPIVOT on the sales table to transpose rows to columns, then join back to the category dimension.
Explanation

The PIVOT clause in Spark SQL is the direct, idiomatic way to transpose rows into columns. The syntax SELECT * FROM sales PIVOT (SUM(sales_amount) FOR month IN ('Jan', 'Feb', 'Mar')) aggregates sales_amount per category for each specified month value, producing one output column per month. The CASE WHEN approach using conditional aggregation is a valid but verbose alternative that would require writing a separate CASE expression for every month, making it harder to maintain. UNPIVOT performs the reverse operation — it converts columns into rows, the opposite of what is needed here. Window functions like RANK() calculate ordinal positions within partitions; they do not transpose rows into columns and cannot produce the pivoted output.

5.

A data engineer is designing ingestion for a sensor dataset that arrives as Avro files in cloud storage. The files arrive continuously every 5 minutes. The downstream analytics team queries aggregated data hourly and can tolerate up to 15 minutes of latency. The team wants to minimize infrastructure management. Which ingestion pattern is MOST suitable?

  • A. Spark Structured Streaming with a continuous trigger processing Avro files with sub-second latency.
  • B. A Lakeflow Spark Declarative Pipeline using Auto Loader in batch trigger mode scheduled every 15 minutes.✓ Correct
  • C. Spark Structured Streaming with a 5-minute trigger interval reading Avro files with Auto Loader, writing to a Delta table.
  • D. A micro-batch job using COPY INTO in a Databricks Workflow scheduled every 5 minutes.
Explanation

A Lakeflow Spark Declarative Pipeline with Auto Loader in batch trigger mode scheduled every 15 minutes is the best fit. It processes all new files accumulated since the last run, meets the 15-minute latency SLA, minimizes infrastructure management through the managed pipeline service, and handles Avro ingestion natively. Structured Streaming with a 5-minute trigger would also meet the latency requirement but runs a persistent cluster even when no files arrive, increasing cost and management burden. COPY INTO in a scheduled workflow every 5 minutes adds operational overhead of managing a job schedule and does not benefit from Auto Loader's file-tracking and scalability improvements. Continuous trigger mode processes data with millisecond latency and requires a continuously running cluster, which is massively over-engineered for a 15-minute latency tolerance and incurs unnecessary cost.

Test yourself across every DP-750 domain

The free DP-750 practice test mixes about 20 questions weighted like the exam. The full 229-question bank adds instant grading, flashcards and a timed mock exam.

Study this domain

Prepare and process data study guide (DP-750) →

Other DP-750 domains

← All Microsoft Data Engineering with Azure Databricks study resources