Practice Interview Questions
| Question | Status |
|---|---|
Sometimes, payment transactions are repeated by accident; it could be due to user error, API failure or a retry error that causes a credit card to be charged twice.
Using the transactions table, identify any payments made at the same merchant with the same credit card for the same amount within 10 minutes of each other. Count such repeated payments.
Assumptions:
transactions table:
| Column Name | Description |
|---|---|
| transaction_id | Identifier for the transaction |
| merchant_id | Identifier of the merchant |
| credit_card_id | Identifier of the credit card used |
| amount |
| Total amount in the transaction |
| transaction_timestamp | Time the transaction occurred |
| payment_count |
|---|
| 5 |
Sometimes, payment transactions are repeated by accident; it could be due to user error, API failure or a retry error that causes a credit card to be charged twice.
Using the transactions table, identify any payments made at the same merchant with the same credit card for the same amount within 10 minutes of each other. Count such repeated payments.
Assumptions:
transactions table:
| Column Name | Description |
|---|---|
| transaction_id | Identifier for the transaction |
| merchant_id | Identifier of the merchant |
| credit_card_id | Identifier of the credit card used |
| amount | Total amount in the transaction |
| transaction_timestamp | Time the transaction occurred |
| payment_count |
|---|
| 5 |