Member-only story
A Bookkeeping Service (or a Ledger Component) is a service that keeps track of money sent and money received on behalf of a client. The purpose of this service is to record all financial activities and allow getting the account balance for a given client.
In this post, we will discuss the design of a Bookkeeping Service / Ledger Component, which is asked in lots of interviews, especially by Fin-Tech companies.
High Level Thoughts
Basically we need to design a system that keeps track of transactions and account balances for the clients. And this will be a system dealing with money, so consistency and accuracy will play an important role.
Below are the topics first come up into my mind when I am about to design the system:
- Support of different currencies — We need to clarify with the interviewer whether our system need to support currencies other than USD
- Support of refunds — We can treat refunds as a special kind of transaction with the amount being negative. Other than that, it should be easy to deal with.
- Idempotency — This is one of the most important factor we must keep in mind when designing the system. Idempotency is a design principle that performing the same operation multiple times would not change the result, the result will be the same as performing the operation once only. Consider the following scenario, the client made a…