Vadatech Inc. Interview Question

How to optimize the database queries?