Detect YouTube Channels With Upload Gaps Longer Than Thirty Days

Last updated: November 29, 2026

Quick Overview

Using a table of public YouTube video uploads, list every gap longer than 30 days between consecutive uploads on the same channel, with the gap's start, end and length.

Google
Data Manipulation (SQL/Python)
Data Scientist
Google
November 29, 2026
Data Scientist
Phone Screen
Data Manipulation (SQL/Python)
Easy

0

0

0 solved


Using a table of public YouTube video uploads, list every gap longer than 30 days between consecutive uploads on the same channel, with the gap's start, end and length.

A short YouTube creator analytics question that Google phone screens use to test comfort with LAG and date arithmetic. Creator inactivity is a real signal for creator support and churn work, so the interviewer may ask how you would turn the result into a metric.

What the Interviewer Expects
  • Use LAG over each channel ordered by publish time
  • Compute day differences with the right date function
  • Exclude the first upload, which has no previous upload
  • Filter on the computed gap in an outer query or repeated expression
  • Mention how to treat channels whose current silence exceeds 30 days
Key Topics to Cover
LAG
date arithmetic
creator analytics
window functions
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you also include channels that have been silent for 30 days up to today?
  • What share of creators who go silent for 30 days ever upload again?
  • Several videos can be published the same day. Does that affect your answer?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

videos(video_id, channel_id, published_at, visibility). I only count public uploads because private and unlisted ones are not what viewers see. A gap is measured in calendar days between consecutive...

Approach

For each upload, LAG gives the previous upload date on the same channel. Rows with a previous date and a difference above 30 days are the gaps. Ordering the window by the full timestamp rather than ...


Submit Your Answer
Markdown supported