Amazon interview question

SQL window function and different types of joins