Questions › Technical PM › Top-Interview
Write a query to find the top 3 unique salaries in each department and list all employees who have those salaries.
- Technical PM
- Top-Interview
- Medium
- 10 min
Focus on structuring your SQL query to first identify the top 3 unique salaries within each department. Use window functions like `ROW_NUMBER()` or `RANK()` to rank salaries, ensuring you account for ties appropriately. After determining the top salaries, join this result with the employee table to retrieve the corresponding employee details. Be prepared to explain your thought process, including how you handle potential edge cases, such as departments with fewer than three unique salaries.
What this question tests
- Technical PM
- Structured problem solving
- Communication
- Trade-off reasoning
Practise this question under interview conditions. Answer it out loud against a timer with an AI interviewer that asks follow-ups, then review the scored report.
Related Technical PM questions
- Design an Instagram Ranking ModelTop-Interview · Technical PM · Hard
- Design a cashless candy dispensing machine.Top-Interview · Technical PM · Hard
- Design a system to upgrade hundreds of thousands of machines on the Moon.Top-Interview · Technical PM · Hard
- How would you explain what an OS is to your grandmother?Top-Interview · Technical PM · Hard
- Design ChatGPTTop-Interview · Technical PM · Hard
- How is gradient descent and model optimization used in linear regression?Top-Interview · Technical PM · Hard
All Technical PM questions · Product manager interview questions by skill area