Reward System

Company: Altimetrik_3oct

Difficulty: medium

Problem Statement

Reward System Problem Description Design a payment app that supports three types of transactions: Peer-to-peer ( P2P ) Peer-to-merchant ( P2M ) Self ( Self ) The app runs a reward system. Whenever a user makes a P2M transaction, that user is eligible for a reward if they are among the top 100 users in terms of the total amount of P2M transactions they have made. Implement the Payment class: TransactionSummary makePayment(int transactionId, int senderId, int amount, TransactionType transactionType) Records a transaction of type transactionType in which user senderId pays amount units. Returns a TransactionSummary object holding the given transactionId and isSenderEligibleForReward , which tells whether the sender is eligible for a reward according to the rule above. int getNumberOfTransactions(int senderId, TransactionType transactionType) Returns the number of transactions of type transactionType that user senderId has made so far. The TransactionSummary class (two attributes: transact