PySpark Lakehouse
6 interview problems on Delta transaction logs, VACUUM, CDC and MERGE, change feeds, time travel and Iceberg partitioning, from easy to hard.
Learn Lakehouse
- The Delta transaction log · 8 min read. Commit files, checkpoints and optimistic concurrency: how the _delta_log turns files into a table.
- MERGE INTO and upserts · 7 min read. Matched, not-matched and not-matched-by-source clauses, step by step, and the duplicate-source error.
- Slowly changing dimensions (SCD Type 2) · 8 min read. Keep the full history of a dimension with one MERGE per batch, and the edge cases that break it.
- VACUUM and retention · 6 min read. Delete old data files safely without breaking running readers or time travel.
- Change Data Feed · 5 min read. Read the row-level inserts, updates and deletes made to a Delta table between two versions.
- Time travel and RESTORE · 5 min read. Query or roll back to any earlier version of a table, and what retention does to that promise.
- Streaming into Delta tables · 7 min read. Write a stream into a Delta table exactly once, and read a Delta table as a stream.
- Constraints and generated columns · 6 min read. NOT NULL and CHECK constraints, generated columns and identity columns in Delta tables.
- Rebuild a Table from Its Transaction Log · Medium · Lakehouse, Joins, Aggregations
- Files VACUUM Can Delete · Medium · Lakehouse, Joins, Aggregations
- Iceberg Hidden Partition Layout · Medium · Lakehouse, Aggregations, Dates
- Apply a CDC Batch (MERGE Semantics) · Hard · Lakehouse, Window Functions, Joins
- Net Changes from a Change Feed · Hard · Lakehouse, Aggregations, Conditional Logic
- What Changed Between Two Versions · Hard · Lakehouse, Joins, Strings
Browse
Topics: Window Functions · Joins · Aggregations · Pivot, Unpivot & Rollup · Arrays · Null Handling · Conditional Logic · Dates · Filtering & Selection · Strings · Data Lake · Lakehouse · Streaming · Data Prep for AI · Spark Performance
Difficulty: Easy · Medium · Hard · Learn · All problems · dbt practice