Company: Truecaller Backend Engineer Assessment_9may
Difficulty: medium
Timestamp values range from 1 to 10 9 . Queries will be given in the order of strictly increasing timestamps. Level 2 The banking system should support ranking accounts based on the total value of transactions. List<String> topActivity(int timestamp, int n) — should return the top n accounts with the highest total value of transactions sorted in descending order (in case of ties, sorted alphabetically by accountId in ascending order). The returned value should be a list of strings representing an array of accounts and transaction values in this format ["<accountId1>(<transactionsValue1>)", "<accountId2>(<transactionsValue2>)", ..., "<accountIdN>(<transactionsValueN>)"] . Total value of transactions is defined as the sum of all transactions for an account (regardless of how the transaction affects account balance), including the amount of money deposited, withdrawn, and/or successfully transferred (transfers will be introduced on level 3, so you