FastPrepUsers with Three Transactions in Sixty Seconds
Problems/Users with Three Transactions in Sixty Seconds

Users with Three Transactions in Sixty Seconds

Mastercard logoMastercard● MediumFULLTIMEPHONE SCREEN
QuestionConstraints

Problem statement

Source note: A public Mastercard Senior Data Engineer interview recap asks candidates to flag a user who performs three transactions within sixty seconds. Inclusivity and output shape are authored; the judged core matches about 96%.

Return every user who has any three transactions occurring within an inclusive 60-second window.

For each user's chronologically ordered transactions, a qualifying window exists when the third transaction is at most 60 seconds after the first.

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.

transactions

ColumnTypeNullableDescription
transaction_idPKIntegerNo—
user_idIntegerNo—
transaction_timeTimestampNo—

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
user_idIntegerNo—

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

Constraints

  • Order equal timestamps by transaction ID.
  • Return each qualifying user once.
  • Sort user IDs ascending.

More Mastercard problems

  • 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
All Mastercard interview questionsSee Mastercard hiring insights