Capgemini interview question

Optimization in Spark