United Airlines interview question

Advanced-level SQL query using Windows and CTE functions