Virtusa interview question

Some basic programming questions.