Amazon Interview Question

SQL window function and different types of joins