Partitions: The Unit of Parallelism
Your data does not arrive at an executor as one big table. Spark splits it into chunks called partitions. A partition is a contiguous slice of the rows, typically targeted around 128 MB, that lives in memory on one executor. A billion-row table might be 8,000 partitions. This split is the single most important idea in Spark, because it is the unit of parallelism: one task processes exactly one partition. 1 : 1 Why this is the number that matters Because tasks map one-to-one onto partitions, the partition count is the parallelism ceiling. If your data is in 4 partitions, at most 4 things can happen at once, no matter how many machines you rented. If it is in 8,000 partitions and you have 200 CPU cores, Spark works through them 200 at a time in waves. A SQL engine hides this from you; Spark
About This Interactive Section
This section is part of the How a Spark Job Runs lesson on DataDriven, a free data engineering interview prep platform. Each section includes explanations, worked examples, and hands-on code challenges that execute in real time. SQL queries run against a live PostgreSQL database. Python runs in a sandboxed Docker container. Data modeling problems validate against interactive schema canvases. All content is framed around what data engineering interviewers actually test at companies like Meta, Google, Amazon, Netflix, Stripe, and Databricks.
How DataDriven Lessons Work
DataDriven combines four interview rounds (SQL, Python, Data Modeling, Pipeline Architecture) with adaptive difficulty and spaced repetition. Easy problems get harder as you improve. Weak concepts resurface until you master them. Your readiness score tracks progress across every topic interviewers test. Every lesson section ends with problems you solve by writing and running real code, not by picking multiple-choice answers.