Cognizant interview question

Some basic SQL and oops concepts