Cognizant Interview Question

Simple Oops concept and basic programming