Intuit interview question

average sql, and algorithms, not very original