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
Data Manipulation (SQL/Python)
Data Scientist
Charta Health
November 29, 2026
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
Easy

0

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
GROUP BY
conditional aggregation
deduplication
HAVING
rates
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 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 Problems
Sample 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', ...)...


Submit Your Answer
Markdown supported

Related Questions