Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Detect Sudden Reviewer Accuracy Drops

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Detect Sudden Reviewer Accuracy Drops. Start with the requirements and the one table on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

You are given review outcomes for a set of reviewers. Write a PostgreSQL query that flags the first day each reviewer’s accuracy drops by at least 20 percentage points compared with the previous review day, and returns the reviewer, the date of the drop, the prior day’s accuracy, the current day’s accuracy, and the size of the drop.

Use only the data in the table below. Treat accuracy as correct_reviews / total_reviews, and ignore rows where total_reviews = 0 when calculating accuracy. Return one row per reviewer for the first qualifying drop, ordered by the largest drop first.

Schema

reviewer_daily_stats
ColumnTypeDescription
reviewer_idINTReviewer identifier
reviewer_nameVARCHAR(100)Reviewer display name
review_dateDATEDate of the review batch
correct_reviewsINTNumber of correct reviews on that day
total_reviewsINTTotal reviews completed that day
Tablesreviewer_daily_stats
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results