Published · By Henry Palma
Databricks Data Engineer Associate Practice Quiz, Lesson 12: Spark Tuning, Broadcast Joins and Re-measuring
Practice quiz for the Databricks Data Engineer Associate exam, Lesson 12: shuffle partitions, broadcast hints, data skew, and re-measuring each change.
Exam-style question: 199 of 200 join tasks finish in under a minute, and one runs 40 minutes because most orders belong to one customer. The engineer doubles the workers. What happens? Little changes. The oversized partition is still processed by one task, no matter how many executors are free. Adaptive Query Execution (AQE) skew join handling, or a broadcast of the small side, helps instead. This post is the practice quiz companion to Lesson 12 of the Databricks Data Engineer Associate exam prep series, in Section 3 of the August 2026 exam guide, Data Transformation and Modeling (22% of the exam).

Watch the full Lesson 12: Spark Tuning Basics video if you want the walkthrough, then use this quiz to check yourself.
The notebook and cheat sheet are in the A12 folder on GitHub. The PDF cheat sheet is in the same folder.
This is independent study material, not official Databricks training. The eight questions below are original practice items written by Build and Teach from the public exam guide and Databricks documentation. They are not real exam questions and are not affiliated with or endorsed by Databricks.
What this quiz covers
The exam objective is basic Spark tuning, and the habit that goes with it: change one setting, then re-measure. For a DataFrame or SQL join, the post-shuffle partition count is spark.sql.shuffle.partitions. spark.default.parallelism is the Resilient Distributed Dataset (RDD) setting, so it does nothing for a DataFrame join. A broadcast hint in the query is part of the query, not a config. Spark prioritizes it even when spark.sql.autoBroadcastJoinThreshold is set to -1. That threshold only controls automatic broadcasts.
On Databricks Free Edition, and on serverless notebooks in general, only a few Spark properties can be set. spark.sql.shuffle.partitions is one of them. The broadcast threshold, default parallelism, and executor or driver memory are classic compute settings. On serverless, use a broadcast hint when you need to force a broadcast. Executor and driver memory are set when classic compute starts, mostly through the node type you pick. A spark.conf.set in a running notebook is too late, because those processes are already running.
Skew is the trap in the hook question. If one task runs much longer than the rest because one key has most of the rows, adding workers does not split that partition. AQE skew join handling, or broadcasting the small side, is the better move. After any change, re-run the same query on the same data several times, compare medians, and confirm the results are identical. A job that only "feels faster" is not a measurement.
Pause the video when the timer shows, pick A, B, C or D, then check the answer. Seven or more of the eight questions right means you are ready for this section.
Practice questions from the quiz video
These are the eight questions from the quiz video, with answers and explanations.
Question 1
In open-source Apache Spark, what is the default value of spark.sql.shuffle.partitions?
- A) 8
- B) 64
- C) 200
- D) The number of executor cores
Answer: C. The Apache Spark default is 200. Databricks serverless uses auto instead, and Adaptive Query Execution (AQE) can coalesce small partitions at runtime.
Question 2
A teammate set spark.sql.autoBroadcastJoinThreshold to -1. What does that do?
- A) Broadcasts every table in a join
- B) Turns off automatic broadcast joins
- C) Uses the default 10 MB threshold
- D) Lets AQE pick the threshold
Answer: B. -1 disables automatic broadcasting, so a join with a small table shuffles and sorts both sides, unless a hint asks for a broadcast.
Question 3
A DataFrame join's post-shuffle partition count is wrong for the data size. Which setting controls it?
- A) spark.default.parallelism
- B) spark.executor.memory
- C) spark.sql.shuffle.partitions
- D) spark.driver.memory
Answer: C. DataFrame and SQL shuffles use spark.sql.shuffle.partitions. spark.default.parallelism is the RDD setting, so it does nothing for a DataFrame join.
Question 4
Which of these Spark properties can you set in a serverless notebook, such as on Databricks Free Edition?
- A) spark.sql.shuffle.partitions
- B) spark.sql.autoBroadcastJoinThreshold
- C) spark.executor.memory
- D) spark.default.parallelism
Answer: A. Serverless allows only a few Spark properties, and shuffle partitions is one of them. The other three are classic compute settings. On serverless, use a broadcast hint instead.
Question 5
On classic compute, this cell runs. Which join does the plan show?
from pyspark.sql import functions as F
spark.conf.set("spark.sql.autoBroadcastJoinThreshold", "-1")
o = spark.table("silver.ordersbig") c = spark.table("silver.customersbig")
o.join(F.broadcast(c), "customer_id").explain() ```
- A) SortMergeJoin, shuffling both sides
- B) BroadcastHashJoin
- C) An error, because broadcasting is off
- D) CartesianProduct
Answer: B. A broadcast hint is part of the query, not a config, and Spark prioritizes it even when the threshold says no. The threshold only controls automatic broadcasts.
Question 6
An engineer raises the broadcast threshold and the job feels faster. What should they do next?
- A) Also raise shuffle partitions and executor memory
- B) Re-run the same query several times, compare medians and check results
- C) Keep the change, because it feels faster
- D) Add more executors to confirm
Answer: B. Change one setting, then re-measure the same way: same query, same data, several runs, compare the median and confirm identical results.
Question 7
199 of 200 join tasks finish in under a minute. One runs 40 minutes. Most orders belong to one customer. The engineer doubles the workers. Result?
- A) It finishes in about half the time
- B) Little changes, the big partition is still one task
- C) The job fails, partitions no longer match executors
- D) Spark doubles shuffle partitions and removes the skew
Answer: B. This is skew. One oversized partition is processed by one task, no matter how many executors are free. AQE skew join handling, or a broadcast of the small side, helps instead.
Question 8
Executors on a classic compute job run out of memory. Where does a change to spark.executor.memory belong?
- A) spark.conf.set in a running notebook
- B) The compute configuration, before it starts
- C) A broadcast hint in the query
- D) spark.sql.shuffle.partitions
Answer: B. Executor and driver memory are set when the compute starts, mostly through the node type you pick. The processes are already running by the time a notebook cell runs.
Practical tips
The memory trick from the video: one knob at a time. Then measure again.
If the scenario is a DataFrame or SQL shuffle, reach for spark.sql.shuffle.partitions, not spark.default.parallelism.
If most of the tasks are done and one task is stuck, more executors will not fix it. Look for skew, then consider a broadcast or AQE skew handling. And if you are on serverless, check whether the setting you want is actually allowed there.
Key takeaways
- DataFrame and SQL shuffles use
spark.sql.shuffle.partitions.spark.default.parallelismis for RDDs. - A broadcast hint overrides a threshold of
-1. The threshold only controls automatic broadcasts. - Serverless lets you set shuffle partitions, but not the broadcast threshold, default parallelism, or executor memory. Use a hint to force a broadcast.
- Skew stays on one task when you add workers. AQE skew handling or a broadcast of the small side helps.
- Change one setting, then re-measure: same query, same data, several runs, compare medians, and check results. Set executor memory before classic compute starts.
Check your understanding
1. A DataFrame join shuffles too much data per task. Which setting changes the post-shuffle partition count?
- A)
spark.default.parallelism - B)
spark.sql.shuffle.partitions - C)
spark.executor.memory - D)
spark.sql.autoBroadcastJoinThreshold
2. On a serverless notebook, you want to force a broadcast of a small customers table. What works?
- A) Set
spark.sql.autoBroadcastJoinThresholdto a large value - B) Set
spark.executor.memory - C) Use a broadcast hint in the query, such as
F.broadcast(customers) - D) Set
spark.default.parallelism
3. Most join tasks finish quickly, but one task runs for a long time because one customer has most of the orders. You add more executors. What happens?
- A) The job finishes in about half the time
- B) Little changes, because that oversized partition is still one task
- C) Spark automatically doubles shuffle partitions
- D) The job fails, because partitions no longer match executors
4. You raise the broadcast threshold on classic compute and the job feels faster. What should you do next?
- A) Also raise shuffle partitions and executor memory in the same change
- B) Keep the change, because it feels faster
- C) Re-run the same query several times, compare medians, and check that the results match
- D) Add more executors to confirm
5. Executors on a classic compute job run out of memory. Where does a change to spark.executor.memory belong?
- A)
spark.conf.setin a running notebook - B) The compute configuration, before it starts
- C) A broadcast hint in the query
- D)
spark.sql.shuffle.partitions
Answer key
- B. DataFrame and SQL shuffles use
spark.sql.shuffle.partitions.spark.default.parallelismis the RDD setting. - C. Serverless does not let you set the broadcast threshold or executor memory. A broadcast hint is part of the query and still works.
- B. This is skew. One oversized partition stays on one task no matter how many executors are free.
- C. Change one setting, then re-measure the same way and confirm identical results.
- B. Executor memory is set when the compute starts, mostly through the node type. A running notebook cell is too late.