Twitch·Data Scientist·Technical Phone Screen
- Given minute-level streaming data, compute total monthly hours streamed across all streamers. Output should be labeled as YYYY-MM and ordered chronologically, and must handle data spanning multiple years correctly.
- For each streamer, compute their total streamed minutes and the share of minutes spent in categories matching a given keyword (case-insensitive substring match). Return the keyword share as a ratio.
- For each streamer and calendar month, determine whether their streamed hours increased compared to the immediately preceding calendar month. Treat months with no activity as zero. Only return rows where current month exceeds the previous month.
- For 2019 only, return each streamer's average concurrent viewers and total US viewer-minutes. Join minute_viewed to minute_streamed on both streamer and timestamp to avoid row multiplication. As a follow-up, also count distinct streamed minutes where at least one US viewer was present.
- Explain SQL's logical query processing order and clarify whether AVG() is computed before or after the JOIN.
“The year-boundary thing is what trips people up.”