Cognizant Interview Question

Some basic SQL and oops concepts