Capgemini Engineering interview question

Background