Lennar interview question

A sql question and then a data frame manipulation question/.