r/apachespark • • 7h ago

How I run PySpark practice problems in the browser: Spark in a sandboxed container, checked against hidden tests

7 Upvotes

I've been building a practice site for data engineering interviews, and the trickiest part was PySpark: practicing it usually means a local Spark install or paying for a cluster. Sharing how I solved it, in case it's useful, plus the site itself for anyone prepping.

How it works

  • Each submission runs in a sandboxed AWS Lambda container image with PySpark in local mode, with no cluster
  • Problems give you small typed DataFrames (or views for Spark SQL); your function returns a DataFrame, which is compared against expected output, including hidden edge-case tests
  • The tricky parts were cold starts (Spark's JVM startup in Lambda) and making DataFrame comparison robust to row order and float precision

What you can practice

  • DataFrame API and Spark SQL: joins, window functions, aggregations, dedupe
  • the patterns that come up in interviews: skew, null handling, top-N per group, sessionization

The Easy problems are free and work without an account: queryosity.dev

Curious what this crowd thinks: which Spark topics actually come up in data engineering interviews that I should add?