Enova interview question

How would you write a query to do the following.