Weekly Reviewer Approval Rates for Expert Submissions in SQL

Last updated: November 29, 2026

Quick Overview

Given tables of expert task submissions and reviewer decisions, write SQL that reports, for each expert and ISO week, the number of reviewed submissions, the approval rate, and a flag when the rate drops more than 20 points below the expert's prior four-week average.

Mercor
Data Manipulation (SQL/Python)
Data Scientist
Mercor
November 29, 2026
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
Easy

0

0

0 solved


Given tables of expert task submissions and reviewer decisions, write SQL that reports, for each expert and ISO week, the number of reviewed submissions, the approval rate, and a flag when the rate drops more than 20 points below the expert's prior four-week average.

Mercor sells high-quality expert data to AI labs, so quality operations watch approval rates closely to coach or offboard contributors. The screen checks joins, date bucketing, window functions, and care with submissions that have multiple reviews.

What the Interviewer Expects
  • Pick exactly one decision per submission (the latest review)
  • Bucket by week with date_trunc
  • Compute approval rate as a ratio of counts, guarding divide by zero
  • Use a window frame over the previous four weeks, excluding the current week
  • Explain how missing weeks affect the rolling average
Key Topics to Cover
window functions
deduplication
date bucketing
quality metrics
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 require a minimum number of reviews before flagging?
  • Some reviewers are much harsher than others; how would you adjust for reviewer strictness?
  • How would you make missing weeks count as gaps rather than shrinking the window?
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

submissions(submission_id, expert_id, project_id, submitted_at) and reviews(review_id, submission_id, reviewer_id, decision, reviewed_at) where decision is 'approved' or 'rejected'. A submis...

Approach
  1. Deduplicate reviews with ROW_NUMBER() per submission ordered by reviewed_at DESC.
  2. Join to submissions and aggregate per expert and week.
  3. Compute a rolling average of the prior four weekly...

Submit Your Answer
Markdown supported

Related Questions