There's an orders table with the columns created_at and amount. Write a SQL query that finds anomalous days, where the daily revenue differs from the average over the previous seven days by more than three standard deviations. Keep in mind that on some days there were no orders at all.
~15 min by voice
How to approach it
The interviewer wants to see whether you can work correctly with time series in SQL: fill gaps in the calendar, set the window frame correctly without the current day, and avoid the traps of incomplete history, zero stddev and today's incomplete day.
The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.