Cognizant interview question

basic oops concepts