Accenture interview question

optimization method in the spark