The 200 Knob: spark.sql.shuffle.partitions
Every shuffle produces a number of output partitions, and that number is controlled by a single configuration value: spark.sql.shuffle.partitions. Its default is 200, which means that unless you change it, every shuffle in your job divides its output into exactly 200 partitions, regardless of how much data you have. This one default is behind a surprising share of Spark performance problems, in both directions. Think about what 200 means at different scales. If you are shuffling a few hundred megabytes, 200 partitions means each one is tiny, a couple of megabytes, and you have spun up 200 reduce tasks each doing almost nothing, paying scheduler overhead for trivial work. If you are shuffling a terabyte, 200 partitions means each one is five gigabytes, far too large to fit in a reduce task'
About This Interactive Section
This section is part of the Inside the Shuffle 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.