Capgemini interview question

Question in oops. Basics programs