Gap-Filled Rolling Job Postings with Drop Alerts by Industry
Last updated: November 29, 2026
Quick Overview
From a job_postings table, produce a daily series per industry with the trailing seven-day average of new postings, filling days with zero postings, and flag days where postings fall below half of the previous seven days' average.
0
0
0 solved
From a job_postings table, produce a daily series per industry with the trailing seven-day average of new postings, filling days with zero postings, and flag days where postings fall below half of the previous seven days' average.
LinkedIn's Economic Graph and hiring trend reports track job posting volume by industry, and sudden drops are often data outages rather than real hiring changes. The interviewer is checking gap filling, window frames and avoiding false alerts from partial windows.
What the Interviewer Expects
- Builds a calendar so zero-posting days exist as rows
- Cross joins industries with the calendar before the left join
- Uses ROWS frames, not RANGE, with the correct bounds
- Excludes the current day from the baseline used for alerting
- Suppresses alerts when the window is incomplete
- Discusses weekday seasonality
Key Topics to Cover
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
- How would you compare to the same weekday last week instead?
- How would you tell a pipeline outage from a real hiring drop?
- What would you change for hourly data?
- How would you avoid alert spam for tiny industries?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice SQL ProblemsSample Answer
Clarify the Data
job_postings(job_id, industry, posted_at). Output one row per industry per day from Jan 1 to Mar 31, with postings, a seven-day trailing average including today and an alert flag. The baseline for t...
Approach
- Generate a calendar starting seven days before the report start so the first report day has a full baseline.
- Cross join with distinct industries and left join daily counts, coalescing to 0. With...