Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Reviewer Quality and Bottleneck Analysis

MediumSQL · PostgreSQL00:00
I
Practice interviewer
Your interviewer
In session
I
Interviewer

Welcome to the SQL screen.

The question is on your right: Reviewer Quality and Bottleneck Analysis. Read through the requirements and the three tables first.

Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?

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

Problem

You are given review workflow data and need to analyze reviewer quality and operational bottlenecks. Write a PostgreSQL query that returns each reviewer’s name, the number of completed reviews in the last 30 days, their average review score, the percentage of reviews completed late, and a simple bottleneck flag that marks reviewers with either a low average score or a high late-completion rate.

Use only reviews that are marked completed, and treat a review as late when completed_at is later than due_at. Return reviewers with at least 3 completed reviews, ordered by the bottleneck flag first, then by average score ascending, then by completed review count descending.

Schema

reviewers
ColumnTypeDescription
reviewer_idPKINTPrimary key for each reviewer
reviewer_nameVARCHAR(255)Reviewer display name
teamVARCHAR(100)Team or function
reviews
ColumnTypeDescription
review_idPKINTPrimary key for each review
reviewer_idINTForeign key to reviewers.reviewer_id
statusVARCHAR(20)Review status such as completed or pending
scoreINTReview quality score from 1 to 5
assigned_atTIMESTAMPWhen the review was assigned
due_atTIMESTAMPWhen the review was due
completed_atTIMESTAMPWhen the review was completed, if completed
assignments
ColumnTypeDescription
assignment_idPKINTPrimary key for each assignment event
review_idINTForeign key to reviews.review_id
queue_nameVARCHAR(100)Queue or workstream name
priorityINTPriority level of the assignment
Tablesreviewersreviewsassignments
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results