FastPrepStatus Changes in Log Data
Problems/Status Changes in Log Data

Status Changes in Log Data

Mastercard logoMastercard● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionConstraints

Problem statement

Source note: Reported in a Mastercard phone screen. The report names a window-function task to find status changes in log data. We chose the table layout, the rules for grouping and breaking ties in order, what to do with the first row, and the output columns. Our version is about 86% the same as the reported question.

Each row in status_logs records the status of one entity at an event time.

Within each entity, order logs by event_time and then log_id. Return every noninitial row whose status differs from the immediately preceding row for that entity.

Include both the previous and current status for each transition.

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.

status_logs

ColumnTypeNullableDescription
log_idPKIntegerNo—
entity_idIntegerNo—
event_timeTimestampNo—
statusTextNo—

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
log_idIntegerNo—
entity_idIntegerNo—
event_timeTimestampNo—
previous_statusTextNo—
current_statusTextNo—

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

Constraints

  • log_id is unique.
  • Status comparisons are exact and case-sensitive.
  • Rows with the same event_time are ordered by log_id.
  • The first row for an entity is not a status change.
  • Sort by entity_id, event_time, and log_id ascending.

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
  • Employees with the Highest and Lowest SalaryPHONE SCREEN · Seen Apr 2025
  • Inactive Customers with Prior ActivityPHONE SCREEN · Seen Nov 2024
  • Merchant Category Transaction SummaryPHONE 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