FastPrepEmployees with the Highest and Lowest Salary
Problems/Employees with the Highest and Lowest Salary

Employees with the Highest and Lowest Salary

Mastercard logoMastercard● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionConstraints

Problem statement

Source note: A public post presents this as a hard Mastercard PySpark interview question. It gives the worker and title tables, sample rows, and the labels for highest and lowest salary. We chose how to handle ties and the order. Our version is about 97% the same as the reported question.

Return every employee whose salary equals the company-wide maximum or minimum.

Join each worker to the supplied current title and add salary_type: Highest Salary for the maximum and Lowest Salary for the minimum.

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.

workers

ColumnTypeNullableDescription
worker_idPKIntegerNo—
first_nameTextNo—
last_nameTextNo—
salaryDecimalNo—
joining_dateDateNo—
departmentTextNo—

titles

ColumnTypeNullableDescription
worker_ref_idPKIntegerNo—
worker_titleTextNo—
affected_fromDateNo—

Foreign key: worker_ref_id → workers(worker_id)

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
worker_idIntegerNo—
first_nameTextNo—
last_nameTextNo—
salaryDecimalNo—
salary_typeTextNo—
worker_titleTextNo—
departmentTextNo—

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

Constraints

  • The data contains at least two distinct salary values.
  • Each worker has exactly one row in titles.
  • Return all ties, highest rows first, and worker IDs ascending within each group.

More Mastercard Phone Screen questions

  • Top Three Accounts by Monthly Transaction AmountPHONE SCREEN · Seen Sep 2026
  • Deduplicate a List While Preserving OrderPHONE SCREEN · Seen Jul 2026
  • Employee With the Highest SalaryPHONE SCREEN · Seen Jul 2026
  • Group Names by DepartmentPHONE SCREEN · Seen Jul 2026
  • Credit and Debit Transaction Counts per UserPHONE SCREEN · Seen Apr 2026
  • Users with Three Transactions in Sixty SecondsPHONE SCREEN · Seen Apr 2026
  • Container With Most WaterPHONE SCREEN · Seen Oct 2025
  • Inactive Customers with Prior ActivityPHONE SCREEN · Seen Nov 2024
  • Merchant Category Transaction SummaryPHONE SCREEN · Seen Nov 2024
  • Top Customers by Six-Month Transaction AmountPHONE SCREEN · Seen Nov 2024

Similar questions at other companies

  • Nth Highest SalaryPaytm · PHONE SCREENPaytm interview questions
  • Email Funnel: Opened Within a Day, Replied Within a WeekSuperhuman · PHONE SCREENSuperhuman interview questions
  • iPhone Model Sales Share by CountryApple · PHONE SCREENApple interview questions
  • In-Memory Database QueriesOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
  • Top Three Sales per County and YearClickhouse · PHONE SCREEN
  • Block Type with the Most ChildrenNotion · PHONE SCREENNotion interview questions
  • Third-Highest Known SalaryAdobe · PHONE SCREENAdobe interview questions
  • Days Between Each User's Latest Two PostsZip · PHONE SCREENZip interview questions
  • Observed-User Percentage by AppMicrosoft · PHONE SCREENMicrosoft interview questions
  • Nth-Highest Book Sales VolumeAmazon · PHONE SCREEN

Mastercard interview experiences

  • Mastercard Data Science Intern Interviews: 10 Experiences
All Mastercard interview questionsSee Mastercard hiring insights