Capgemini Engineering interview question

Oops concept