Menu

Course · Distributed processing

PySpark for Data Engineers

Free PySpark course for Data Engineers: DataFrames, joins, window functions, partitions, shuffles and skew, with runnable code and interview questions.

Lessons
12
Interview questions
8
Projects & case studies
2
Reading time
~5 h

Your progress

Saved in this browser only

Course structure

Practise

Practice

88 problems in 5 topics, from basic to advanced. 2 have a full DataDank answer; 86 more are free problems on Spark Playground and StrataScratch that open on the platform. 0 of 88 done.

Spark Playground: free PySpark problems0/15
  1. Load and Transform Data (opens Spark Playground in a new tab)EasySpark Playground (opens in a new tab)
  2. Handling Null Values (opens Spark Playground in a new tab)EasySpark Playground (opens in a new tab)
  3. Total Purchases by Customer (opens Spark Playground in a new tab)EasySpark Playground (opens in a new tab)
  4. Clean Support Ticket Tags (opens Spark Playground in a new tab)EasySpark Playground (opens in a new tab)
  5. Streaming Device Split (opens Spark Playground in a new tab)EasySpark Playground (opens in a new tab)
  6. Last Visit Checkouts (opens Spark Playground in a new tab)EasySpark Playground (opens in a new tab)
  7. Workout Span (opens Spark Playground in a new tab)EasySpark Playground (opens in a new tab)
  8. Top Support Agents (opens Spark Playground in a new tab)EasySpark Playground (opens in a new tab)
  9. Top Delivery Cities (opens Spark Playground in a new tab)EasySpark Playground (opens in a new tab)
  10. Monthly Hotel Ratings (opens Spark Playground in a new tab)EasySpark Playground (opens in a new tab)
  11. Running Payroll (opens Spark Playground in a new tab)MediumSpark Playground (opens in a new tab)
  12. Food and Beverage Sales (opens Spark Playground in a new tab)MediumSpark Playground (opens in a new tab)
  13. Word Count Program in PySpark (opens Spark Playground in a new tab)MediumSpark Playground (opens in a new tab)
  14. Parse Product Attributes JSON (opens Spark Playground in a new tab)MediumSpark Playground (opens in a new tab)
  15. Department Budget Utilization (opens Spark Playground in a new tab)HardSpark Playground (opens in a new tab)
StrataScratch: easy (solve in PySpark)0/30
  1. Find all posts which were reacted to with a heart (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  2. Finding Updated Records (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  3. Total Cost Of Orders (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  4. Workers With The Highest Salaries (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  5. Average Salaries (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  6. Completion Rate by Title (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  7. Calculate Samantha's and Lisa's total sales revenue (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  8. Wine varieties tasted by 'Roger Voss' (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  9. Hour Of Highest Gas Expense (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  10. Find all Lyft rides which happened on rainy days before noon (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  11. Lyft Driver Wages (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  12. Artist Appearance Count (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  13. Top Ranked Songs (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  14. Olympics Events List By Age (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  15. Find all athletes who were older than 40 years when they won either Bronze or Silver medals (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  16. Order Details (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  17. Departments With 5 Employees (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  18. April Admin Employees (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  19. First Names With Six Letters Ending in 'h' (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  20. Find drafts which contains the word 'optimism' (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  21. Number of violations (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  22. Inspection For Glassell Coffee Shop (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  23. Churro Activity Date (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  24. Most Profitable Financial Company (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  25. MacBookPro User Event Count (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  26. Contact Information Completeness (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  27. Users Missing Phone Numbers (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  28. High Earners in Support Departments (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  29. Number of Shipments Per Month (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
  30. Unique Users Per Client Per Month (opens StrataScratch in a new tab)EasyStrataScratch (opens in a new tab)
StrataScratch: medium (solve in PySpark)0/36
  1. Users By Average Session Time (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  2. Acceptance Rate By Date (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  3. Finding User Purchases (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  4. Risky Projects (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  5. Busiest Restaurants in June 2025 (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  6. Thumbs-Up Rate by Model Version (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  7. AI Feature Adoption Funnel (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  8. Finding Purchases (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  9. Ranking Most Active Guests (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  10. Number Of Units Per Nationality (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  11. Find the number of inspections for each risk category by inspection type (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  12. Find the percentage of shippable orders (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  13. Meta/Facebook Matching Users Pairs (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  14. Matching Similar Hosts and Guests (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  15. Income By Title and Gender (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  16. Top Cool Votes (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  17. Reviews of Categories (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  18. Top Businesses With Most Reviews (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  19. Find all possible varieties which occur in either of the winemag datasets (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  20. Highest Target Under Manager (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  21. Highest Salary In Department (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  22. Employee and Manager Salaries (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  23. Second Highest Salary (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  24. Titanic Survivors and Non-Survivors (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  25. Duplicate HR Department Employees (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  26. Employees With the Same Salary (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  27. Count Occurrences Of Words In Drafts (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  28. Make the friends network symmetric (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  29. Processed Ticket Rate By Type (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  30. Top 10 Songs 2010 (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  31. Customers with Large Orders (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  32. Department Workforce Analysis (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  33. Salary Less Than Twice The Average (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  34. Flags per Video (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  35. Maximum of Two Numbers (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
  36. Share of Active Users (opens StrataScratch in a new tab)MediumStrataScratch (opens in a new tab)
StrataScratch: hard (solve in PySpark)0/5
  1. Consecutive Days (opens StrataScratch in a new tab)HardStrataScratch (opens in a new tab)
  2. Best Selling Item (opens StrataScratch in a new tab)HardStrataScratch (opens in a new tab)
  3. Rank Variance Per Country (opens StrataScratch in a new tab)HardStrataScratch (opens in a new tab)
  4. Monthly Percentage Difference (opens StrataScratch in a new tab)HardStrataScratch (opens in a new tab)
  5. Counting Instances in Text (opens StrataScratch in a new tab)HardStrataScratch (opens in a new tab)
Worked answers (DataDank only)0/2
  1. When should you avoid Python UDFs in PySpark?MediumDataDank only
  2. When would you use a broadcast join in Spark?MediumDataDank only

Ticks are saved in this browser only and match the ticks on the interview pages.

Lessons

Work through the lessons in order. Completed lessons show a tick; lessons you have opened are outlined.

Start here

The complete overview of the course in one read.

  1. PySpark Fundamentals for Data EngineersPySpark fundamentals in one guide: DataFrames and schemas, lazy evaluation, joins, window functions, UDF alternatives, partitions, shuffles and debugging.Beginner9 min

Beginner

Core concepts you will use every day.

  1. PySpark DataFrames, Columns and SchemasPySpark DataFrames and schemas: explicit StructType schemas, select, withColumn and filter, null handling, and safe type casting under Spark 4 ANSI mode.Beginner24 min
  2. PySpark Transformations vs ActionsUnderstand lazy evaluation in PySpark: transformations build a plan, actions run it, and narrow versus wide transformations decide where Spark shuffles data.Beginner7 min
  3. PySpark Aggregations, Pivot and Temporary ViewsPySpark aggregations: groupBy and agg, rollup and cube subtotals, pivot and unpivot, and sharing DataFrames with SQL through temporary views.Beginner16 min
  4. Reading and Writing Data in PySpark: Parquet, CSV, JSON, ORC, Avro and JDBCRead and write Parquet, CSV, JSON, ORC and Avro in PySpark, capture corrupt records, load JDBC tables in parallel and use partition discovery to prune folders.Beginner25 min

Intermediate

Patterns used in production pipelines.

  1. PySpark Joins and Join StrategyWrite correct PySpark joins, then control how Spark executes them: broadcast hash, sort-merge and shuffle hash joins, hints, AQE, bucketing and bucketed joins.Intermediate26 min
  2. PySpark Window Functions: Ranking, Lag and Running TotalsPySpark window functions for top-N per group, deduplication, lag and lead, running totals, gap filling and sessions, and avoiding single-partition windows.Intermediate18 min
  3. PySpark UDFs, pandas UDFs and the Pandas API on SparkWhen to write Python UDFs in PySpark, how Arrow and pandas UDFs reduce their cost, how applyInPandas and UDTFs work, and when the pandas API on Spark fits.Intermediate18 min
  4. Nested and Complex Types in PySpark: Structs, Arrays, Maps and explodeWork with nested JSON in PySpark: query structs, arrays and maps, use higher-order functions, flatten with explode and posexplode, and rebuild nested output.Intermediate16 min
  5. Writing Efficient Output: File Sizes, Small Files and Partitioned WritesPySpark write performance: repartition vs coalesce before a write, partitioned output, the small files problem, fewer shuffles and custom partitioners.Intermediate21 min
  6. PySpark vs pandas vs Polars: When to Use EachPySpark vs pandas vs Polars: execution models, memory limits, APIs, Arrow interchange, testing and cost, with one task run in all three and when to pick each.Intermediate20 min

Interview preparation

The top interview questions, with answers.

  1. Top 50 PySpark and Spark Interview Questions and Answers50 PySpark interview questions with answers and code: shuffles, joins, skew, caching, memory tuning and Structured Streaming. For freshers and experienced.Intermediate109 min

Projects and case studies

Apply what you learned and prepare material to discuss in interviews.

Projects

Resources

Cheat sheets

Related courses

Plan your learning

Search
Filter by type