Skill Zuno · skillzunos.com · Python Data Science
PySpark interview questions
Prepare for PySpark interviews on Skill Zuno. This practice book covers PySpark interview questions across New, Easy, Medium, Hard, and Diff levels so you can work through real interview-style problems on skillzunos.com.
Open PySpark on Skill ZunoAlso see the PySpark tutorial.
PySpark is the Python API for Apache Spark, the distributed engine for processing big data across a cluster. It provides DataFrames and Spark SQL, Structured Streaming and MLlib, and an optimiser that plans work across many machines. Interviews cover the Spark architecture, lazy transformations and actions, partitions and shuffles, joins and skew, caching, UDF performance and tuning jobs.
Sample PySpark interview questions
What is the difference between a transformation and an action?
Transformations, such as filter and select, are lazy and build a plan. Actions, such as count, collect and write, trigger execution of the plan.
What is a shuffle and why is it costly?
Moving data between executors so records with the same key end up together, as needed for groupBy and joins. It involves disk and network I/O and often dominates job time.
What is a broadcast join?
Sending a small table to every executor so it can be joined with a large table without shuffling the large one. Spark does it automatically below a size threshold, or with broadcast().
Why are Python UDFs slow, and what is the alternative?
Row-by-row Python UDFs move data between the JVM and Python and block optimisation. Prefer built-in functions, or use pandas UDFs, which process Arrow batches in vectorised form.
What is the difference between repartition and coalesce?
repartition can increase or decrease partitions and performs a full shuffle for an even spread. coalesce only reduces partitions by merging them, avoiding a full shuffle.
What you can practice
- PySpark interview questions for beginners and experienced developers
- Level-based practice: New, Easy, Medium, Hard, and Diff
- Python Data Science topics alongside PySpark on skillzunos.com