In Spark, what's the difference between a narrow and a wide transformation, and why does the distinction matter for performance?

technical-conceptual · Junior level · data-ml

What the interviewer is really asking

Assess whether the candidate understands that wide transformations trigger a shuffle and can connect that to job performance, rather than treating all Spark operations as equally cheap.

What to say

What to avoid

Example answers

Strong: On a job that joined a 2-billion-row events table to a small 5k-row lookup, I broadcast the lookup so the join stayed narrow instead of shuffling the big table — the stage that had been the bottleneck dropped from minutes to seconds.

Weak: Narrow and wide are just two ways to write the same thing, so I use whichever reads more cleanly.

Want questions matched to your role? Paste a job title, job description, or CV and get a personalized set, or go Pro to unlock the full bank.