PracHub
QuestionsLearningGuidesInterview Prep

Quick Overview

Work through a tie-aware PostgreSQL problem that finds every highest-paid employee in each department. It assesses relational reasoning, correct joins, duplicate-name handling, and precise output semantics without assuming a single winner.

  • medium
  • Otter.Ai
  • Data Manipulation (SQL/Python)
  • Data Engineer

Find the Highest-Paid Employee in Each Department

Company: Otter.Ai

Role: Data Engineer

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Technical Screen

The interview report explicitly identified the “Department Highest Salary” SQL exercise. Use the following self-contained PostgreSQL schema: ```text departments ----------- department_id BIGINT PRIMARY KEY name TEXT NOT NULL employees --------- employee_id BIGINT PRIMARY KEY name TEXT NOT NULL salary NUMERIC NOT NULL department_id BIGINT NOT NULL REFERENCES departments(department_id) ``` Write one PostgreSQL query that returns every employee whose salary equals the highest salary in that employee's department. Return exactly these columns: - `department`: the department name - `employee`: the employee name - `salary`: the employee salary If several employees tie for the highest salary in a department, return all of them. Departments with no employees do not appear. Do not assume department names or employee names are unique. The relative order of returned rows does not matter.

Quick Answer: Work through a tie-aware PostgreSQL problem that finds every highest-paid employee in each department. It assesses relational reasoning, correct joins, duplicate-name handling, and precise output semantics without assuming a single winner.

Last updated: Jul 24, 2026

Related Coding Questions

  • Find Every Project with the Most Employees - Otter.Ai (medium)

Loading coding console...

PracHub

Master your tech interviews with 8,500+ 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.