The Ones Who Hold Attention
A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- medium
- Seniority
- mid
Problem
The content team has noticed that raw view counts are flattering the wrong people: a creator can rack up opens and still lose everyone in the first ten seconds, while a quieter creator keeps people glued to the end. Leadership wants to reward the second kind. For every creator who has had at least one of their pieces actually watched, work out how completely their audience tends to make it through a piece, on average, treating each view's progress as the fraction of the piece's length that was watched (watch_seconds divided by that piece's duration_seconds), and only counting pieces whose duration_seconds is greater than zero. Return three columns per creator: creator_id, how many views fed into that figure (total_views), and the average completion fraction rounded to 4 decimal places (avg_completion_ratio). Present the creators in order of who holds attention best, with the most engaging at the top; break ties by creator_id ascending.
Summary
Plenty of creators get the click. Find the ones who actually keep people watching.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.