Cognizant interview question

Encapsulation , inheritance and other oops concepts