Rank Recruiters by InMail Reply Rate Within Each Region

Last updated: November 29, 2026

Quick Overview

Using inmails and recruiters tables, return the top two recruiters by InMail reply rate in each region for March, among recruiters who sent at least 50 InMails, along with the region's overall reply rate.

LinkedIn
Data Manipulation (SQL/Python)
Data Scientist
LinkedIn
November 29, 2026
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


Using inmails and recruiters tables, return the top two recruiters by InMail reply rate in each region for March, among recruiters who sent at least 50 InMails, along with the region's overall reply rate.

InMail reply rate is a headline metric in LinkedIn Recruiter, and sales and customer success teams use per-region leaderboards. The interviewer is testing window functions over grouped data, tie handling and whether you notice that a minimum volume filter changes the benchmark.

What the Interviewer Expects
  • Aggregates to recruiter level before ranking
  • Applies a minimum volume filter with HAVING
  • Uses DENSE_RANK or ROW_NUMBER deliberately and explains ties
  • Computes a region benchmark with a window over the aggregate
  • Uses COUNT(replied_at) to count non-null replies
Key Topics to Cover
DENSE_RANK
window aggregates
HAVING filters
per-group top N
rate 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 add month-over-month change for each recruiter with LAG?
  • Should the region rate include recruiters below the volume threshold?
  • How would you count only replies within 14 days of sending?
  • Why might raw reply rate be a poor ranking metric for low-volume recruiters?
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

recruiters(recruiter_id, region) and inmails(inmail_id, recruiter_id, sent_at, replied_at), where replied_at is null when no reply. I will confirm: March means InMails sent in March, reply rate ...

Approach
  1. Aggregate to one row per recruiter for March, keeping only those with 50 or more sends.
  2. Rank within region by reply rate with DENSE_RANK.
  3. Compute region reply rate as `SUM(replies) / SUM(se...

Submit Your Answer
Markdown supported