FastPrepFilter Excel Employee Records with Pandas
Problem · Database

Filter Excel Employee Records with Pandas

Easyinfosys logoinfosysNEW GRADONSITE INTERVIEW

Problem statement

An Excel workbook contains an Employees worksheet. The worksheet has already been loaded for you as the Pandas DataFrame employees.

Keep only rows where department is exactly "Engineering", years_experience is at least 3, and is_active is true.

Return a DataFrame with the columns employee_id, employee_name, and years_experience, in that order. Sort the rows by employee_id in ascending order. If no row qualifies, return an empty DataFrame with those same columns.

Table schema

Pandas

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

Rows from the already-loaded Employees worksheet.

ColumnTypeNullableDescription
employee_idPKIntegerNoUnique employee identifier.
employee_nameTextNoEmployee display name.
departmentTextNoCase-sensitive department name.
years_experienceIntegerNoCompleted years of experience.
is_activeBooleanNoWhether the employee is currently active.

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
employee_idIntegerNo
employee_nameTextNo
years_experienceIntegerNo

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

Constraints

  • 0 ≤ employees.length ≤ 2,000.
  • employee_id values are unique integers in [0, 9,000,000,000,000,000].
  • employee_name and department are non-empty strings of at most 100 characters.
  • 0 ≤ years_experience ≤ 60.
  • is_active is boolean.
  • Department comparison is case-sensitive; do not trim or normalize text.

More infosys problems