Capgemini interview question

Java