FastPrepMaximum Employee Salary for a Company
Problems/Maximum Employee Salary for a Company

Maximum Employee Salary for a Company

PeopleStrong logoPeopleStrong● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionConstraints

Problem statement

Source note: Reported in a PeopleStrong phone screen. The report asks for an Employee and Company data model and a query for the maximum salary of a company. We wrote the schemas, the way requests are passed in, and the NULL behavior. Our version is about 90% the same as the reported question.

Use the companies and employees tables to find the maximum employee salary for the company identified by the single row in requested_company.

Return exactly one row with the column max_salary. Ignore unknown (NULL) salaries. The requested company exists. If it has no employees with a known salary, return NULL in that one row.

Company IDs identify companies, even when names are equal. Salaries are nonnegative integers. The request table only tells you which company to use.

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.

companies

ColumnTypeNullableDescription
company_idPKIntegerNo—
company_nameTextNo—

employees

ColumnTypeNullableDescription
employee_idPKIntegerNo—
company_idIntegerNo—
salaryIntegerYes—

Foreign key: company_id → companies(company_id)

requested_company

ColumnTypeNullableDescription
company_idPKIntegerNo—

Foreign key: company_id → companies(company_id)

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
max_salaryIntegerYes—

Row order: must match exactly. Numeric tolerance: 0.

Constraints

  • For this exercise, assume 1 to 10000 companies and 0 to 100000 employees.
  • Company and employee IDs are positive unique integers within their respective tables, at most 10^9.
  • Every employee and the requested company reference an existing company ID.
  • requested_company contains exactly one row.
  • A salary is NULL or an integer from 0 through 10^9.
  • Company names are nonempty strings of at most 100 characters and need not be unique.

More PeopleStrong Phone Screen questions

  • Reverse Linked-List Nodes in Groups of KOA · PHONE SCREEN · Seen Mar 2026
  • Level of the Minimum-Sum SubtreePHONE SCREEN · Seen Jan 2026
  • Ceiling Value in a Sorted ArrayPHONE SCREEN · Seen Sep 2025
  • Valid ParenthesesPHONE SCREEN · Seen Sep 2025
  • Number of ProvincesPHONE SCREEN · Seen May 2025
  • Shortest Subarray with an Exact Target SumPHONE SCREEN · Seen May 2025
  • Add Forward Linked-List Numbers Using RecursionPHONE SCREEN · Seen Oct 2021
  • Running Median of a StreamPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2021
  • Build an Expression Tree from PostfixPHONE SCREEN · Seen Oct 2021
  • Maximum Score from Deleting Neighboring ValuesPHONE SCREEN · Seen Oct 2021

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

  • PeopleStrong SDE OA and Interview Questions: 12 Experiences
All PeopleStrong interview questionsSee PeopleStrong hiring insights