FastPrepTransaction Volume by Country

Transaction Volume by Country

Mastercard logoMastercard● EasyFULLTIMEPHONE SCREEN

Problem statement

Given credit-card transactions, calculate the total transaction amount for every country.

Return country and total_transaction_amount, ordered by total amount descending and then country ascending.

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—
countryTextNo—
transaction_dateDateNo—
transaction_amountDecimalNo—

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
countryTextNo—
total_transaction_amountDecimalNo—

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

Constraints

  • Every transaction has one country and a non-negative amount.
  • All transaction rows count.
  • Use exact decimal arithmetic.

More Mastercard problems

See Mastercard hiring insights