Cohort 4Register
PySpark Projects

PySpark Projects for Beginners: Six Builds, the Dataset for Each, and the Interview Question It Prepares

Six PySpark projects, from a first groupBy to a streaming job with a watermark, each with a dataset you can open today, what it proves and the interview question it prepares.

By Durgesh Yadav — Senior Data Engineer @ 7-Eleven · Updated 15 Oct 2026. Preparation guidance, not a hiring guarantee.

Which PySpark projects should a beginner build first?

Start with joins and aggregations on Chinook, then window functions on Northwind, both on PrepNPlaced's Coding Practice with no install. Next, clean a month of NYC taxi trips in Parquet and write it partitioned. Then build a layered Databricks pipeline, a nested-JSON job and a streaming job. Put two or three on GitHub with a README you can defend.

Guide

What To Learn And How To Practice

Which PySpark projects should you build, and in what order?

Build them in the order interview questions get harder: aggregations, window functions, file formats and partitioning, a layered pipeline, nested data, then streaming. Spark is worth the effort. In PrepNPlaced's India Tech Hiring Report, Spark was named in 17.2% of 1,470 data-engineer postings and Databricks in 19.1% of 1,470, collected 23 August to 27 September 2026. The report counted whole words, so a posting that wrote only "PySpark" is not in the Spark figure.

Six PySpark projects in rising difficulty
ProjectDatasetWhat it provesInterview question it prepares
1. Revenue by country and genreChinook, on Coding PracticeJoins and aggregates with no duplicated rowsWhat is the difference between a transformation and an action?
2. Top products and running totalsNorthwind, on Coding PracticeWindow functions: dense_rank, running sums, lagFind the top 3 spending customers in each country.
3. Clean and partition taxi tripsNYC TLC trip records (Parquet)Cleaning rules and partitioned writesHow would you partition this output?
4. IPL medallion pipelinePrepNPlaced's cricket projectBronze, Silver and Gold layers on DeltaWhat happens if the job runs twice?
5. GitHub events from nested JSONGH Archive hourly filesNested fields and deduplicationHow do you handle a field missing from some files?
6. Streaming event countsGH Archive files replayed into a folderWatermarks and checkpointsWhat does a watermark do to late data?

How do you start Projects 1 and 2 without installing Spark?

Start on PrepNPlaced's Coding Practice, where the PySpark questions run on two datasets: Chinook, a music store's invoices and tracks, and Northwind, a trading company's orders and products. Each table is preloaded as a DataFrame named after it, and your answer goes in result. Run executes your code on a live Spark sandbox and shows the first 50 rows; Submit grades the full output. Running is free; you sign in to submit. For Project 1, solve join and aggregate questions such as "Total revenue by genre". For Project 2, move to window functions on Northwind, such as "Top 3 spending customers within each country". The example below reads the CSV files first, so it also runs outside Coding Practice.

Project 1 proves: you can chain joins without duplicating rows
Project 2 proves: you know when to use row_number, rank or dense_rank

Project 2: top 3 products per category by revenue (Northwind)

result = spark.read.csv("order_details.csv", header=True, inferSchema=True).withColumn("Revenue", F.col("UnitPrice") * F.col("Quantity") * (1 - F.col("Discount"))).groupBy("ProductID").agg(F.sum("Revenue").alias("Revenue")).join(spark.read.csv("products.csv", header=True, inferSchema=True).select("ProductID", "ProductName", "CategoryID"), "ProductID").withColumn("rnk", F.dense_rank().over(Window.partitionBy("CategoryID").orderBy(F.desc("Revenue")))).filter(F.col("rnk") <= 3)

Project 3: how do you clean and partition a real public dataset?

Use the NYC Taxi and Limousine Commission trip records, published monthly as Parquet files with a data dictionary and a taxi zone lookup table in CSV. Read one month of yellow taxi trips and count the rows that make no sense: zero distances, zero amounts, drop-offs before pick-ups. Filter them out, join the zone lookup for borough names, and write the result partitioned by pick-up date. In Databricks, the samples catalog has samples.nyctaxi.trips, though Databricks says sample datasets can change without notice. This project teaches cost. Every groupBy and join shuffles into spark.sql.shuffle.partitions partitions, 200 by default per the Spark tuning guide, and adaptive query execution, on by default since Spark 3.2.0, uses run-time statistics to pick a better plan.

Interview draw: why partition by date and not timestamp, and repartition against coalesce
README numbers: rows dropped by each rule, and files per date before and after repartition

Clean one month and write it partitioned by date

spark.read.parquet("yellow_tripdata_2024-01.parquet").filter((F.col("trip_distance") > 0) & (F.col("total_amount") > 0) & (F.col("tpep_dropoff_datetime") > F.col("tpep_pickup_datetime"))).withColumn("pickup_date", F.to_date("tpep_pickup_datetime")).repartition("pickup_date").write.mode("overwrite").partitionBy("pickup_date").parquet("trips_clean")

Project 4: what does the PrepNPlaced cricket project add?

It adds the shape most data engineering interviews expect: a layered pipeline on Databricks. PrepNPlaced's PySpark on Cricket Data project takes raw IPL ball-by-ball data into Databricks and models it Bronze, Silver and Gold through a modular PySpark pipeline, tuned with cache(), partitions and shuffle settings, with outputs written to Delta. The paid module, opened by Learn Pass or by buying that session's recording, holds the recording, the class dataset, four notebooks (00 Config, 01 Bronze, 02 Silver, 03 Gold) and the complete notes, whose first pages are readable without signing in. To build it from public files instead, Cricsheet publishes IPL match data as JSON, mostly under the Open Data Commons Attribution License, so credit Cricsheet in your README.

Interview draw: why Bronze keeps the raw record, and what makes a write safe to run twice
Where to run it: Databricks Free Edition, free for personal, non-commercial use

Projects 5 and 6: how do you move on to nested JSON and streaming?

Use GH Archive, which records the public GitHub timeline as hourly gzip-compressed JSON files at data.gharchive.org, named like 2015-01-01-15.json.gz. Spark reads them directly with spark.read.json. Project 5 selects the nested repo fields, drops duplicate events by id, and counts events per repository for one day. Project 6 copies those files into a landing folder one at a time and reads it with spark.readStream. Add a watermark on event time, count events in five-minute windows and write to Delta with a checkpoint. The Spark streaming guide states the trade: late data within the watermark's threshold is aggregated, and later data can be dropped. Restart the query and show that the counts did not double.

Interview draw: what changes when data arrives late, twice, or with a new field

Project 6: windowed counts with a watermark, written to Delta

query = spark.readStream.schema(spark.read.json("landing/2015-01-01-0.json.gz").schema).json("landing/").withColumn("event_time", F.to_timestamp("created_at")).withWatermark("event_time", "10 minutes").groupBy(F.window("event_time", "5 minutes"), "type").count().writeStream.outputMode("append").format("delta").option("checkpointLocation", "chk/event_counts").start("gold/event_counts")

How do you put a PySpark project on your resume and GitHub?

Give each project its own repository with a README an interviewer can follow alone, and one resume line naming the data, the stack and a number you measured.

  1. Name the dataset in the README's first line and link its source.
  2. Draw the flow in one line, such as raw Parquet to cleaned table to daily summary.
  3. List the steps that rebuild the output from an empty folder.
  4. State one check, such as a row count, and what it caught.
  5. Write the resume line as built X with Y and measured Z.
  6. Rehearse the data flow, what broke, and what changes at much larger volume.

FAQ

Common Questions

Can I build PySpark projects without a paid cloud account?

Yes. PrepNPlaced's Coding Practice runs PySpark on a live Spark sandbox in the browser, free to browse and run. Databricks Free Edition is free for personal use, with smaller compute and fair-use limits. You can also install PySpark from PyPI on your laptop, as the Spark Installation page shows.

How many PySpark projects should a fresher put on a resume?

Two or three you can defend in depth. An interviewer tends to pick one and ask how it works and what broke, so one project with a README, a check and a measured number beats a list of short tutorials.

Are Chinook and Northwind good enough for a resume project?

For practice, yes, because answers are graded. For the resume, add one public dataset with real mess in it, such as NYC taxi trips or GitHub events; cleaning and partitioning choices give you more to talk about.

Should a PySpark project run on Databricks or plain Apache Spark?

Either works, and most code is the same. Databricks, named in 19.1% of 1,470 data-engineer postings in PrepNPlaced's India Tech Hiring Report, adds Delta tables, notebooks and jobs. Plain Spark on a laptop covers Projects 1, 2, 3 and 5; the Delta writes in Projects 4 and 6 need Delta Lake.

What mistakes make a beginner PySpark project look weak?

Calling collect() or toPandas() on the full dataset, using a Python UDF where a built-in function exists, joining without checking the row count, and publishing with no README. Each tells an interviewer the code ran once on small data.

Next Step

Turn The Guide Into Practice

Use PrepNPlaced tools to turn this learning path into resume proof, targeted practice, and interview-ready explanations.

Practise PySpark on Coding Practice