FastPrepOldest and Youngest Employees

Oldest and Youngest Employees

Intuit logoIntuit● EasyINTERNOA

Problem statement

The employees table contains each employee's full name and date of birth. Return the full name and date of birth of every oldest employee and every youngest employee.

The oldest employees have the earliest date of birth; the youngest employees have the latest date of birth. Include everyone tied at either extreme. Combine the two groups with UNION ALL semantics, so a row appears twice if it belongs to both groups.

Return exactly two columns, FULL_NAME followed by DATE_OF_BIRTH. Row order does not matter.

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
full_nameTextNo—
date_of_birthDateNo—

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
FULL_NAMETextNo—
DATE_OF_BIRTHDateNo—

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

Constraints

  • The table contains at least one employee.
  • Every full_name is non-empty and every date_of_birth is a known date.

More Intuit problems

See Intuit hiring insights