Question 1
A gold metric requires a running total per customer. Which SQL is correct?
- SUM(amount) OVER (PARTITION BY customer_id ORDER BY order_ts ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) — Correct
- CUMULATIVE(amount, customer_id)
- SUM(amount) GROUP BY customer_id, order_ts
- SUM(amount) OVER (PARTITION BY order_ts ORDER BY customer_id ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
Correct answer
SUM(amount) OVER (PARTITION BY customer_id ORDER BY order_ts ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
Explanation
Window frames define running totals per partition.
Question 2
Which statement about schema evolution for Delta writes is correct?
- mergeSchema adds new columns; type changes need other mechanisms — Correct
- Schema evolution removes columns that are missing from the incoming DataFrame
- Schema evolution is enabled by default for every write and cannot be turned off
- mergeSchema changes existing column types automatically, for example from STRING to INT, on every append
Correct answer
mergeSchema adds new columns; type changes need other mechanisms
Explanation
mergeSchema adds columns; widening types uses type widening or explicit table changes.
Question 3
A MERGE with WHEN NOT MATCHED BY SOURCE THEN DELETE runs with a source containing only today's partition of data. What is the risk?
- Only duplicates are deleted
- Unscoped deletion of older target rows — Correct
- Nothing; the clause only applies to today's rows automatically
- The MERGE will fail
Correct answer
Unscoped deletion of older target rows
Explanation
Add a condition (for example AND tgt.date = current_date()) to limit deletions to the scope of the source.
Question 4
A JSON field arrives as an integer in some messages and as a string in others. Silver must store it as BIGINT without losing bad values. Which approach fits?
- Store the field as BINARY so that both representations fit in the same column
- try_cast to BIGINT and keep the raw value in a quarantine column — Correct
- CAST to BIGINT under ANSI mode, which converts every string to a number without raising errors
- Drop the field entirely, because mixed types cannot be stored in Delta tables in any form
Correct answer
try_cast to BIGINT and keep the raw value in a quarantine column
Explanation
try_cast avoids failures while preserving the original for investigation.
Question 5
Which statement about MERGE schema evolution is correct?
- With schema evolution on, new source columns are added — Correct
- MERGE cannot handle schema differences under any setting
- Schema evolution removes target columns not in the source
- MERGE always adds new columns automatically
Correct answer
With schema evolution on, new source columns are added
Explanation
Schema evolution in MERGE adds new columns; it does not drop existing ones.
Question 6
A downstream silver table must also delete rows when the bronze source deletes them for GDPR. Which approach handles this?
- skipChangeCommits
- A daily full refresh
- Rely on VACUUM in bronze, which also removes the matching rows from every downstream table automatically
- Read bronze's Change Data Feed and apply deletes with AUTO CDC or MERGE — Correct
Correct answer
Read bronze's Change Data Feed and apply deletes with AUTO CDC or MERGE
Explanation
Propagating deletes requires processing change records, not ignoring them.
Question 7
A pipeline must apply the same set of 12 expectations to several tables. What is the most maintainable approach?
- A shared rule dictionary with expect_all_or_drop — Correct
- Copy the 12 decorators to each table
- Apply the rules in a dashboard
- Use VACUUM
Correct answer
A shared rule dictionary with expect_all_or_drop
Explanation
expect_all variants accept a dictionary of rules, which can be loaded from shared configuration.
Question 8
Which Delta feature allows changing a column from INT to BIGINT without rewriting data files?
- Type widening — Correct
- Shallow clone, which copies the schema with a different column type
- Change Data Feed, which writes the new type into the change log only
- Deletion vectors, which store the new type alongside the deleted rows
Correct answer
Type widening
Explanation
Type widening supports certain type changes as metadata-only operations.
Question 9
Which command renames a column in a Delta table without rewriting data files?
- VACUUM t RENAME a
- CREATE OR REPLACE TABLE with the new name
- ALTER TABLE t CHANGE a b with overwriteSchema
- RENAME COLUMN with column mapping enabled — Correct
Correct answer
RENAME COLUMN with column mapping enabled
Explanation
Column mapping (name mode) allows renaming and dropping columns as metadata-only operations.
Question 10
A source system sends CDC records (insert, update, delete) with a sequence column seq. The target silver table must reflect only the latest state of each key, handling out-of-order arrival, in a Lakeflow declarative pipeline. Which approach is correct?
- Append all CDC records to silver and let consumers filter the latest version
- AUTO CDC with keys, SEQUENCE BY seq and APPLY AS DELETE WHEN op = 'DELETE' — Correct
- Use a streaming table with dropDuplicates on the key, which keeps the first record seen per key
- Use a materialized view that selects MAX(seq) per key from the CDC feed
Correct answer
AUTO CDC with keys, SEQUENCE BY seq and APPLY AS DELETE WHEN op = 'DELETE'
Explanation
AUTO CDC handles ordering with SEQUENCE BY, applies deletes, and manages late or out-of-order events. dropDuplicates keeps the first record, not the latest.