Prepin
Log in

Develop a banking system that allows for account creation, money deposits and transfers, as well as displaying the most active accounts based on total financial transactions, utilizing commands processed through CSV/JSON parsing.

Approach / Explanation

The inquiry requests that you create a system that mimics a basic banking service with the following features: Establishing individual bank accounts. Executing transactions such as money deposits and transfers. Keeping an activity log for each account, reflecting monetary transactions. Ranking the most active accounts based on their total monetary activity. Commands should be inputted and processed through CSV/JSON parsing. It is essential to recognize that this system entails both software design and the selection of a data structure for storing and retrieving information. To get a clearer idea of how to assemble the system, consider the following steps: System design : You should outline the architecture, detailing how various services and data structures will interact. Command parsing : Concentrate on the mechanics of interpreting commands formatted in CSV/JSON. Explain how this parsing will lead to actions such as transfers and deposits. Data structure : Explain which data structures you will utilize and why they are the most appropriate for this task. Tracking monetary activity : Provide a method for monitoring an account’s monetary activity and maintaining a log. Identifying most active users : Describe the approach you will take to list the most active users based on their total monetary activity.

Suggested Answer

The system designed with an object-oriented approach may appear as follows: the primary Bank class is tasked with overseeing BankAccount instances and Transaction instances. Each BankAccount would possess fundamental attributes such as the account holder, account balance, and a collection of Transaction instances that depict the deposit and transfer activities associated with the account. The Transaction class would keep track of the transaction amount, type, the parties involved, and the timestamp of the transaction. To process commands from CSV/JSON, programming language libraries such as Python’s csv and json libraries would facilitate the effective conversion of CSV/JSON formatted data into banking commands. For monitoring financial activities, each time a transaction occurs, I would refresh two lists within the Bank class: one for all transactions and another for total account activity organized by account ID. When the system is required to generate a report on the most active accounts, it can achieve this by examining the total account activity list and sorting it in descending order.

Alternative Answer

To monitor all accounts and their transactions, I suggest establishing two classes: Account and Transaction . The Account class would include attributes such as ID, balance, and a list of transactions. I may choose to implement a Queue data structure for transaction storage, as it efficiently manages tasks like adding a transaction to the end and removing the oldest one when it’s necessary to limit the length of the transaction history. Conversely, the Transaction class would contain all relevant details of a transaction, including the type (either deposit or transfer), the amount, and a timestamp. To interpret the CSV/JSON command, I would utilize a utility library to extract the data and link each command to a specific method in the Account class. For activity tracking, each added transaction would increment a count variable within the Account instance. A Priority Queue in the banking system could hold all accounts, using each account's transaction count as the basis for comparison. When necessary, we can simply retrieve the top accounts from the Priority Queue to identify the most active ones.

Question Details

Difficulty & Category

Medium

Companies

Capital One

Product

For CandidatesFor RecruitersCompaniesBrowse JobsInterview QuestionsDeep ProfileSkill AssessmentOpportunity Matching
Prepin.ai

© 2026 Prepin LLC · Philadelphia, PA · All rights reserved.