Digital Cheetah interview question

1. Write a query 2. Find a bug in code