Capgemini interview question

Oops questions Pattern development question