PracHub
QuestionsLearningGuidesInterview Prep

Quick Overview

This question evaluates proficiency in SQL ranking and tie-resolution techniques for generating deterministic top-N leaderboards, focusing on handling identical scores while producing an exact set of rows.

  • medium
  • Meta
  • Data Manipulation (SQL/Python)
  • Data Scientist

Resolve Ties for Top-10 Users in SQL Query

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Onsite

Oculus_Scores +---------+-------+ | user_id | score | +---------+-------+ | u1 | 95 | | u2 | 92 | | u3 | 90 | | u4 | 90 | | u5 | 88 | +---------+-------+ ##### Scenario Meta DSPA onsite – SQL screen on Oculus dataset; need top-10 leaderboard when ranks 10 and 11 are tied. ##### Question Table Oculus_Scores(user_id, score) holds daily user scores. Write a SQL query that returns exactly the top-10 users by score even when users ranked 10 and 11 have identical scores. Explain your logic. ##### Hints Use DENSE_RANK vs ROW_NUMBER; trim with LIMIT or sub-query so only first 10 rows are emitted after ordering.

Quick Answer: This question evaluates proficiency in SQL ranking and tie-resolution techniques for generating deterministic top-N leaderboards, focusing on handling identical scores while producing an exact set of rows.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 9,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Calculate Daily Survey Response Rates by Country - Meta (medium)
  • Compare Survey Satisfaction for New and Established Users - Meta (medium)
  • Find A Low-Quality Annotator From Label Data - Meta (hard)
  • Analyze Thirty-Day Ad Performance with SQL - Meta (medium)
  • Compute Each Advertiser's Share of Shop Ad Spend - Meta (medium)