PySpark Conditional Logic
12 interview problems on when/otherwise and derived columns, from easy to hard.
Learn Conditional Logic
- when / otherwise · 4 min read. CASE WHEN logic inside a column: first match wins, and a missing otherwise means null.
- coalesce · 4 min read. Take the first non-null value from several columns, and why it is not the same as fillna.
- Categorize Orders · Easy · Conditional Logic, Filtering & Selection
- Label Late Shipments · Easy · Dates, Null Handling, Conditional Logic
- Conditional Aggregation · Medium · Aggregations, Conditional Logic
- Parse UTM Parameters · Medium · Strings, Conditional Logic, Filtering & Selection
- Pick the Join Strategy · Medium · Spark Performance, Joins, Conditional Logic
- Find Files Spark Cannot Split · Medium · Data Lake, Aggregations, Conditional Logic
- Conversion Funnel · Hard · Aggregations, Conditional Logic
- Reconcile Two Sources (Full Outer Join) · Hard · Joins, Null Handling, Conditional Logic, Filtering & Selection
- Sessionize a Clickstream · Hard · Window Functions, Dates, Null Handling, Conditional Logic, Filtering & Selection
- Subtotals with ROLLUP · Hard · Pivot, Unpivot & Rollup, Aggregations, Conditional Logic, Filtering & Selection
- All Combinations with CUBE · Hard · Pivot, Unpivot & Rollup, Aggregations, Conditional Logic
- Net Changes from a Change Feed · Hard · Lakehouse, Aggregations, Conditional Logic
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