FastPrepTransaction Amount Mean and Standard Deviation

Transaction Amount Mean and Standard Deviation

Mastercard logoMastercard● EasyFULLTIMEPHONE SCREEN

Problem statement

Calculate the arithmetic mean and population standard deviation of all transaction amounts.

Return two rows in this exact order: mean, then population_stddev. Round both values to two decimal places using ordinary half-up rounding.

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

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
metricTextNo—
metric_valueDecimalNo—

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

Constraints

  • At least one transaction is present.
  • Use population standard deviation, dividing variance by the number of transactions.
  • Use exact decimal input values and round only final results.

More Mastercard problems

See Mastercard hiring insights