Aspect Ratio Inc. interview question

Got asked several sql window function queries