Capgemini interview question

DS and Algorithm