LinkedIn: Skill Overlap

10pts
Linked In, Glassdoor

Problem Statement

LinkedIn’s recommendation engine needs to highlight "Top Applicants" for recruiters. A top applicant is defined as someone who possesses at least 80% of the skills listed as required for a job.

Write a query to find all such users for Job ID 1001.

Rules:

  • Only consider skills that are explicitly listed as required for Job ID 1001 in the job_requirements table.
  • A user must have the exact skill name (case-sensitive) in the user_skills table to count as a match.
  • The match percentage should be calculated as: (number of matching skills / total number of skills required for the job).
  • Only return users with a match percentage >= 80%.
  • Output columns: user_id, matched_skills_count, match_percentage.
  • Result must be sorted by match_percentage descending, then user_id ascending.
Tests your understanding of
Joins, Aggregation, Filtering and Division

Input Tables

job_requirements
job_id(INTEGER)skill_name(VARCHAR)
1001SQL
1001Python
1001Tableau
1001AWS
1001Spark
1002Java
1002Docker
user_skills
user_id(INTEGER)skill_name(VARCHAR)
1SQL
1Python
1Tableau
1AWS
1Spark
2SQL
2Python
2Tableau
2AWS
3SQL
3Python
3C++
4Java
5SQL
5Python
5Tableau
5Spark

Expected Output

user_id(INTEGER)matched_skills_count(INTEGER)match_percentage(DECIMAL)
15100
2480
5480

Tags

HardJoinsAggregationFilteringDivision
20-30 min
42%

Hints