Enova Interview Question

How would you write a query to do the following.