DoorDash·Data Scientist·Technical Phone Screen
- Given an orders table with columns for order ID, user ID, order date, city, and order value, write a single SQL query that returns each order alongside the previous order value for that same user (NULL if it's their first), the rank of that order's value within its city from highest to lowest, and the percent rank of the order value within its city.
“Three window functions in one query.”