FastPrepEmployees Whose Manager Left the Company
Problems/Employees Whose Manager Left the Company

Employees Whose Manager Left the Company

ZS logoZS● EasyNEW GRADONSITE INTERVIEW

Updated Nov 2026

QuestionConstraints

Problem statement

Source note: The interview report explicitly names the SQL task Employees Whose Manager Left the Company. The schema, the exact salary limit, how null managers are handled, and the ordering follow the well-known prompt for that title.

Find the IDs of employees whose salary is strictly less than 30000 and whose recorded manager no longer appears in the Employees table.

Employees with a null manager_id do not qualify. Return employee IDs in ascending 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.

employees

ColumnTypeNullableDescription
employee_idPKIntegerNo—
nameTextNo—
manager_idIntegerYes—
salaryIntegerNo—

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
employee_idIntegerNo—

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

Constraints

  • employee_id is unique.
  • manager_id may be null or may reference an employee who is no longer present.
  • Return one row per qualifying employee, ordered by employee_id.

More ZS Onsite Interview questions

  • Merge k Sorted ListsONSITE INTERVIEW · Seen Sep 2026
  • Merge Two Sorted Linked ListsONSITE INTERVIEW · Seen Sep 2026
  • Fifth Highest Salary In A DepartmentONSITE INTERVIEW · Seen Sep 2026
  • Find Duplicate Email AddressesONSITE INTERVIEW · Seen Sep 2026
  • Top Salaries By DepartmentONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Delete Duplicate Employee RecordsInfosys · ONSITE INTERVIEWInfosys interview questions
  • Records Created or Updated in a Time WindowPelatro · ONSITE INTERVIEW
  • Top Ten Employee SalariesSolytics Partners · ONSITE INTERVIEW
  • Latest New JobSphere · ONSITE INTERVIEW
  • Employees Above Average SalaryJP Morgan Chase · ONSITE INTERVIEWJP Morgan Chase interview questions
  • Employees Without a ManagerBank of America · ONSITE INTERVIEWBank of America interview questions
  • Retrieve Every Student RecordLSEG · ONSITE INTERVIEWLSEG interview questions
  • Combine Winner and Loser NamesAmazon · ONSITE INTERVIEW
  • Conditionally Insert or Update RecordsKlaviyo · ONSITE INTERVIEWKlaviyo interview questions
  • Employees with Matching DepartmentsAMD · ONSITE INTERVIEWAMD interview questions
All ZS interview questionsSee ZS hiring insights