Capgemini interview question

Oops concepts