Files
bank/CHALLENGE.md
2020-10-13 01:49:59 +02:00

1.8 KiB
Raw Blame History

There is no time limit to this exercise, and the exercise is intended to be relatively short. Please dont spend more than a handful of hours on it.

Please write the code as you would if you were intending to put it into production. Please write in Python.

Oh, and dont worry, we wont really be asking you to write banking software!

Specification

Were going to be keeping track of financial transactions between different parties — people and organisations. In our system, these parties are identified by a simple string such as "john" or "supermarket", and you will be provided with a ledger of transactions that looks like this:

2015-01-16,john,mary,125.00

2015-01-17,john,supermarket,20.00

2015-01-17,mary,insurance,100.00

Note: You will need to generate the necessary data to demonstrate the capabilities of your program.

In this example, John pays Mary §125.00 (§ is our fictional currency) on the 16th of January, and the next day he pays the supermarket §20.00, and Mary pays her insurance company, which costs her §100.00.

Your task will be to write a software system that can process a ledger in this format, and provide access to the accounts of each of the named parties, assuming they all started with a balance of zero. For example, the supermarket has received §20.00, so thats its balance. John has paid out §125.00 to Mary and §20.00 to the supermarket, so his balance is in debit by §145.00. In other words, his balance is §-145.00.

Of course, theres a twist, which is as follows. Wed like to be able to find out what each partys balance is at a specified date. For example, Marys balance on the 16th of January is §0.00, but on the 17th its §125.00.

You dont need to implement any kind of user interface for your program. Well experiment with your code in a REPL.