Loading...

Search Algorithm Rating

A hard SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.

Domain
SQL
Difficulty
hard
Seniority
junior, mid

Problem

We need a search quality score for each query. Assign a rating: 1 if no result was clicked, 2 if a result was clicked but the top clicked position was outside the top 3, and 3 if a result was clicked in positions 1 through 3. Show each query ID and its rating.

Practice This Problem

Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a live PostgreSQL database and grades it instantly.