Tesla interview question

Basic sql queries with window functions