Monthly Pre-Bill Finding Rate per Provider With Duplicate Reviews
Last updated: November 29, 2026
Quick Overview
Given a chart_reviews table (chart_id, provider_id, service_date, finding_count) that can contain duplicate rows from re-runs, write SQL that returns each provider's monthly count of reviewed charts, charts with at least one finding, and the finding rate, keeping only provider-months with at least a minimum number of charts.
Charta Health
November 29, 20260
0
0 solved
Given a chart_reviews table (chart_id, provider_id, service_date, finding_count) that can contain duplicate rows from re-runs, write SQL that returns each provider's monthly count of reviewed charts, charts with at least one finding, and the finding rate, keeping only provider-months with at least a minimum number of charts.
Charta Health customers get automated provider feedback, and a finding rate per provider per month is the base metric behind it. This screen checks basic aggregation, handling duplicate pipeline rows, and resisting tiny-denominator noise.
What the Interviewer Expects
- Deduplicates re-run rows before aggregating
- Counts charts with findings, not total findings, for a rate
- Uses floating point division to avoid integer truncation
- Applies a minimum-volume filter with HAVING
- Explains why the volume filter matters for provider feedback
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 rank providers fairly when their specialties have very different baseline finding rates?
- What if a chart is re-reviewed and the finding count changes; which row wins?
- How would you add a 3-month rolling rate?
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
One row per review run, keyed by chart_id, but a pipeline re-run can insert an identical row. A chart belongs to one rendering provider. finding_count is the number of issues the review raised; the ...
Approach
Dedupe first with SELECT DISTINCT over the full row (if re-runs could change values, I would instead keep the latest run per chart with ROW_NUMBER()). Bucket by month with strftime('%Y-%m', ...)...