Cognizant interview question

Sql query for count and sub queries