Tesla Interview Question

Basic sql queries with window functions