Cognizant Interview Question

basic oops concepts