Cores and Slots

An executor is not a single worker. It has a number of cores, and each core can run one task at a time. So an executor with five cores is processing five partitions simultaneously. The cleanest way to picture it is as slots: a slot is a place where a task can be running right now. Your total parallelism -- the number of tasks that can be in flight across the whole cluster at any instant -- is simply the sum of all the slots on all the executors. This is the number that, together with the partition count from earlier, decides how long your job takes on the wall clock. Now put the last two sections together, because this is where the whole execution model snaps into focus. You have a fixed number of partitions, which is the work, and a fixed number of slots, which is the workforce. If a stag

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.