FastPrepDepartments With the Highest Average Salary
Problems/Departments With the Highest Average Salary

Departments With the Highest Average Salary

Bloomberg LP logoBloomberg LP● EasyFULLTIMEPHONE SCREEN

Updated Feb 2026

QuestionConstraints

Problem statement

Source note: Reported in the first round of a Bloomberg interview for a senior software role. The report names the two tables and their columns, and asks which departments pay best on average. Every tied department counts, and order does not matter.

The report does not say what to return for each department, how big the tables are, or what to do with a department that has no employees. Here, each winner is returned as its id and name, a department with no employees is never returned, and there are at most 2000 employees, 200 departments and 99 employees per department.

Our version is about 85% the same as the reported question.

A company stores its staff in two tables, Employee and Departments. Find the department, or departments, whose employees have the highest average salary.

Example: Engineering pays 90 and 300, so its average is 195. Sales pays 200, 200 and 200, so its average is 200. Sales wins, even though Engineering has the single highest salary.

Return one row for each winning department, with its id and name.

  • A department's average is the total salary of its employees divided by the number of its employees.
  • If several departments share the highest average, return all of them.
  • A department with no employees has no average. Never return it.
  • If there are no employees at all, return no rows.
  • The rows can be in any order.

Table schema

MySQLPostgreSQLPandas

Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.

Departments

ColumnTypeNullableDescription
idPKIntegerNo—
nameTextNo—

Employee

ColumnTypeNullableDescription
idPKIntegerNo—
department_idIntegerNo—
salaryIntegerNo—

Foreign key: department_id → Departments(id)

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
idIntegerNo—
nameTextNo—

Row order: any order is accepted. Numeric tolerance: 0.

Constraints

  • The tables are Employee(id, department_id, salary) and Departments(id, name).
  • id is a unique positive integer in each table. Employee.department_id is the id of a row in Departments.
  • salary is an integer from 0 to 1000000. name is text of 1 to 50 characters. Names can repeat, so a department is identified by its id.
  • Employee has at most 2000 rows and Departments has at most 200 rows. Either table can be empty.
  • Each department has at most 99 employees.

More Bloomberg LP Phone Screen questions

  • N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Fewest Coins CombinationPHONE SCREEN · Seen Nov 2026
  • Recommend Films from Viewers Who Watched Everything You DidPHONE SCREEN · Seen Nov 2026
  • Track New Values in Sorted OrderPHONE SCREEN · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Sparse Vector and Matrix OperationsPHONE SCREEN · Seen Oct 2026
  • Add Two Numbers IIPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026

Similar questions at other companies

  • Second Highest SalaryPaytm · PHONE SCREENPaytm interview questions
  • Employees Who Earn More Than Their ManagersNykaa · PHONE SCREENNykaa interview questions
  • Employees Who Joined More Than a Week AgoNewgen Software · PHONE SCREEN
  • Departments Without EmployeesDell Technologies · PHONE SCREENDell Technologies interview questions
  • Second-Highest Distinct SalaryChubb · PHONE SCREENChubb interview questions
  • Swap Two Gender ValuesInfosys · PHONE SCREENInfosys interview questions
  • Find Rows Common to Two TablesSalesforce · PHONE SCREENSalesforce interview questions
  • Count Records Present in A but Not BCapital One · PHONE SCREENCapital One interview questions
  • Customer Order Count Distribution by CountryApple · PHONE SCREENApple interview questions
  • Employees Earning More Than Their ManagerMygate · PHONE SCREENMygate interview questions

Interview reports that mention this question

  • Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)

Bloomberg LP interview experiences

  • Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
  • Bloomberg SWE Intern Interview Questions: 68 Questions
  • Bloomberg Interview Questions, Level Not Reported: 65 Questions
  • Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 of 2)
  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights