FastPrepTenth-Highest Distinct Salary

Tenth-Highest Distinct Salary

Infosys logoInfosys● MediumFULLTIMEONSITE INTERVIEW

Problem statement

Given an employees table, return the tenth-highest distinct salary.

If fewer than ten distinct salaries exist, return no rows. The output contains one column named salary.

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—
employee_nameTextNo—
salaryIntegerNo—

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
salaryIntegerNo—

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

Constraints

  • Employee identifiers are unique.
  • Salaries are non-null signed integers.
  • Repeated salaries share the same rank.

More Infosys problems

See Infosys hiring insights