CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-5-QUESTIONS practice question 8 of 25

A data engineer is running a Spark job to process a dataset of 1 TB stored in distributed storage. The cluster has 10 nodes, each with 16 CPUs. Spark…

Choose your answer, then check it against the explanation and the full breakdown below.

A data engineer is running a Spark job to process a dataset of 1 TB stored in distributed storage. The cluster has 10 nodes, each with 16 CPUs. Spark UI shows: Low number of Active Tasks Many tasks complete in milliseconds Fewer tasks than available CPUs Which approach should be used to adjust the partitioning for optimal resource allocation?
Answer options
Question 8 of 25

Question breakdown

Tests
Tune partition counts for parallelism
Difficulty
Medium

Key idea: Size partitions from the data volume (about 128 MB each) so there are many more tasks than cores, keeping every core busy while each task stays manageable.

How to reach the answer

  1. The symptoms are few active tasks and fewer tasks than the 160 available cores, which points to too few partitions for the cluster.
  2. A count tied only to hardware (160 or 10 partitions) ignores the 1 TB size and produces multi-GB partitions.
  3. A fixed value such as 200 also ignores data size, giving roughly 5 GB per partition.
  4. 1 TB divided by 128 MB gives about 8,192 partitions, which run in many waves across 160 cores at a safe per-task size.

Each option

  • AIncorrect. 160 partitions of a 1 TB dataset are about 6 GB each, which risks spills and memory errors.
  • BIncorrect. A fixed 200 ignores data volume and still gives multi-GB partitions.
  • CIncorrect. 10 partitions would leave 150 cores idle and produce partitions around 100 GB each.
  • DCorrect. Basing the count on a target size of about 128 MB yields roughly 8,192 partitions, enough to saturate all cores with manageable tasks.

Common trap: Option A sounds like a natural match of one task per core, but it ignores how much data each task would have to process.

In practice: Engineers tune spark.sql.files.maxPartitionBytes, spark.sql.shuffle.partitions, or repartition() based on data volume, and rely on AQE to coalesce small shuffle partitions.

Remember: Derive the partition count from data size divided by a target partition size, not from core or node counts alone.

Drafted with AI assistance and checked against the answer key.

Keep practicing

Take the free CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-5-QUESTIONS practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-5-QUESTIONS practice questions

Scroll to Top