Cognizant interview question

SQL queries, data structures