Employees Earning More Than Their Managers
A easy-tier problem at 72% community acceptance, tagged with Database. Reported in interviews at Wix and 2 others.
You're staring at a problem that sounds simple but trips up candidates who rush: compare salary columns within the same table. Wix, Google, and Yahoo ask this. It's marked Easy, but the 71% acceptance rate tells you plenty of people misread the join condition or build the wrong self-join logic. The pattern is straightforward once you see it, but if you freeze during your live assessment, StealthCoder surfaces the correct query in seconds, invisible to the proctor.
Companies that ask "Employees Earning More Than Their Managers"
Employees Earning More Than Their Managers is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too.
Get StealthCoderThe trick is a self-join on the same table, aliasing it twice so you can compare each employee's salary to their manager's salary. Candidates often either forget to join on the manager ID, or they join incorrectly and miss employees entirely. The gotcha is that some employees have no manager (NULL manager ID), so you need to filter those out or handle them explicitly. Write the join carefully: one alias for the employee table, one for the manager table, join on employee.manager_id = manager.id, then filter where employee.salary > manager.salary. If you blank on the exact syntax during the OA, StealthCoder reads the problem schema and delivers a working solution while you stay calm.
Pattern tags
You know the problem.
Make sure you actually pass it.
Employees Earning More Than Their Managers recycles across companies for a reason. It's easy-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Employees Earning More Than Their Managers interview FAQ
Is this really an Easy problem if Google asks it?+
Yes. Google includes self-joins in their database screening rounds because they're foundational. The 71% pass rate reflects that most people who study SQL basics can solve it, but many candidates skip database drill entirely and get caught off-guard. It's easy once you know the pattern.
What's the main trap candidates fall into?+
Forgetting the self-join or writing a malformed join condition. Some try to solve it without joining the table to itself at all, which fails immediately. Others join but use the wrong column, or don't handle NULL manager IDs, which causes incorrect results.
Do I need to worry about employees with no manager?+
Yes. Most real employee tables have rows where manager_id is NULL (like the CEO). These will be excluded naturally by an INNER JOIN, but if you use LEFT JOIN carelessly, you'll get NULL comparisons. Read the problem statement to confirm what the expected output should include.
Is this question still asked if I interview at these companies?+
Wix, Google, and Yahoo all report asking this problem. It's a stable, low-variance database question in their screening rounds. If your interview loop includes a database component, odds are reasonable you'll see this or a very similar self-join scenario.
How does this relate to other database topics I should know?+
Self-joins are the foundation for hierarchical queries and recursive problems. Once you own the self-join pattern, you can extend it to find paths, chains, or multi-level relationships. This problem is the simplest version. Master it and you're halfway to harder tree or graph queries in SQL.
Want the actual problem statement? View "Employees Earning More Than Their Managers" on LeetCode →