Capgemini interview question

Core java