Home › Interview Questions › In Spark, if you mistakenly set the number of part…

In Spark, if you mistakenly set the number of partitions to 15 instead of 5, what would the output look like when running the command in the Spark terminal?

🟡 Medium Conceptual Junior level
1Times asked
Apr 2026Last seen
Apr 2026First seen

💡 Model Answer

When you set the number of partitions to 15 instead of 5, Spark will create 15 tasks for the operation instead of 5. In the Spark UI, you will see 15 executors or cores being used for that stage, and the task duration will be spread across those 15 tasks. The output will still be correct, but you may see increased overhead due to more shuffle partitions, higher memory usage, and potentially more network traffic. The logs will show 15 stages of the same operation, each with its own task metrics. If you run a simple command like df.repartition(15).count(), the terminal will display the count after all 15 tasks complete, but the progress bar will show 15 tasks instead of 5.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers — invisible to screen sharing.

Get Assisting AI — Starts at ₹500