Home › Interview Questions › Can you tell me the difference between narrow and …

Can you tell me the difference between narrow and wide transformations?

🟢 Easy Conceptual Fresher level
1Times asked
Oct 2026Last seen
Oct 2026First seen

💡 Model Answer

In Spark, narrow transformations are those where each input partition contributes to at most one output partition, so no data shuffling is required. Examples include map, filter, and sample. Wide transformations, by contrast, require data to be shuffled across the cluster because each output partition may receive data from many input partitions. Examples are reduceByKey, groupByKey, and join. Narrow transformations are more efficient because they can be pipelined and executed without network I/O, whereas wide transformations incur the cost of shuffling data between executors.

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 on a discreet on-screen overlay.

Get Assisting AI — Starts at ₹500