Cognizant interview question

Questions from oops and databases.