PySpark practice problems
69 PySpark interview problems, searchable by topic, difficulty and function.
- Filter High Earners · Easy · Filtering & Selection
- Add a Bonus Column · Easy · Filtering & Selection
- Distinct User Actions · Easy · Filtering & Selection
- Build a Price List · Easy · Filtering & Selection
- Paid Orders in March · Easy · Filtering & Selection
- Sort Delivery Options · Easy · Filtering & Selection
- Categorize Orders · Easy · Conditional Logic
- Replace Missing Values · Easy · Null Handling
- Average Salary by Department · Easy · Aggregations
- Departments with Large Teams · Easy · Aggregations
- Find Repeat Customers · Easy · Aggregations
- Label Late Shipments · Easy · Dates
- Order Lines with Product Details · Easy · Joins
- Find Partitions That Need Compaction · Easy · Aggregations
- Combine Batches with Schema Drift · Medium · Filtering & Selection
- Data Quality: Null Count per Column · Medium · Null Handling
- Conditional Aggregation · Medium · Aggregations
- Entry and Exit Pages (MAX_BY / MIN_BY) · Medium · Aggregations
- New Users per Day · Medium · Aggregations
- Median and 90th Percentile · Medium · Aggregations
- Parse Application Log Lines · Medium · Strings
- Parse UTM Parameters · Medium · Strings
- Month Start, Month End and Due Dates · Medium · Dates
- Customers Without Orders · Medium · Joins
- Employees and Their Departments · Medium · Joins
- Year-over-Year Growth · Medium · Joins
- Employees Earning More than Their Manager · Medium · Joins
- Joining on Nullable Keys · Medium · Joins
- Word Count · Medium · Arrays
- Item Positions in a Basket (POSEXPLODE) · Medium · Arrays
- Keep Users with No Interests (EXPLODE_OUTER) · Medium · Arrays
- Sorted Distinct Purchase List · Medium · Arrays
- Learning Path per Student · Medium · Arrays
- Latest Order per Customer · Medium · Window Functions
- Running Total by Region · Medium · Window Functions
- Top Two Salary Levels per Department · Medium · Window Functions
- Month-over-Month Change · Medium · Window Functions
- 7-Day Moving Average · Medium · Window Functions
- Share of Category Total · Medium · Window Functions
- Customer Spend Quartiles (NTILE) · Medium · Window Functions
- Percent Rank and Cumulative Distribution · Medium · Window Functions
- Pivot Quarterly Revenue · Medium · Pivot, Unpivot & Rollup
- Unpivot Wide Columns to Rows · Medium · Pivot, Unpivot & Rollup
- Survey Scores by Question · Medium · Pivot, Unpivot & Rollup
- Iceberg Hidden Partition Layout · Medium · Aggregations
- Rebuild a Table from Its Transaction Log · Medium · Joins
- Files VACUUM Can Delete · Medium · Joins
- How Much Does Each Query Read? · Medium · Joins
- Pick the Join Strategy · Medium · Joins
- Conversion Funnel · Hard · Aggregations
- Price Valid at Order Time (Range Join) · Hard · Joins
- Reconcile Two Sources (Full Outer Join) · Hard · Joins
- Fill Missing Dates (Calendar Spine) · Hard · Joins
- Customers Who Bought Every Product · Hard · Joins
- Monthly Retention by Cohort · Hard · Joins
- Three-Day Login Streak · Hard · Window Functions
- Trailing 3 Calendar Days (Range Frame) · Hard · Window Functions
- Forward-Fill Missing Readings · Hard · Window Functions
- Sessionize a Clickstream · Hard · Window Functions
- Consecutive Status Runs (Gaps and Islands) · Hard · Window Functions
- Build an SCD Type 2 History · Hard · Window Functions
- Upsert: Merge New Records into a Table · Hard · Window Functions
- Subtotals with ROLLUP · Hard · Pivot, Unpivot & Rollup
- All Combinations with CUBE · Hard · Pivot, Unpivot & Rollup
- Pivot with Several Aggregations · Hard · Pivot, Unpivot & Rollup
- Net Changes from a Change Feed · Hard · Aggregations
- Find Hot Keys and Plan Salting · Hard · Joins
- What Changed Between Two Versions · Hard · Joins
- Apply a CDC Batch (MERGE Semantics) · Hard · Window Functions
Browse
Topics: Window Functions · Joins · Aggregations · Pivot, Unpivot & Rollup · Arrays · Null Handling · Conditional Logic · Dates · Filtering & Selection · Strings
Difficulty: Easy · Medium · Hard · PySpark interview roadmap · Learn · All problems