United Airlines interview question

Some sql queries on group by, and windows functions