Shispare Interview Question

How to optimise database queries?