Virtusa interview question

to write a query.