An open API service indexing awesome lists of open source software.

https://github.com/alvaropaco/ledn-code-challenge


https://github.com/alvaropaco/ledn-code-challenge

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Ledn Token Interview Challenge
At Ledn, we are eager to find talented, resourceful, and passionate engineers to help us build the future of digital asset financial services. In light of this, we created a series of steps for us to know each other. One of these is a take home challenge, which will take a few hours to complete.

### Why a take-home challenge?
In-person coding interviews can be stressful and may hide your full potential. A take-home gives you a chance to work in a less stressful environment and showcase your talent.

### Our tech stack
As outlined in our job description, you will come across technologies which include a backend web framework (Typescript with NodeJS runtime) and a frontend library (React).

### Challenge Background
Ledn token is born! .. (fictional). Against our better judgement, we have rushed out our own token. We are now left with a slew of customer data and no way of capturing insights and managing accounts! Help us implement an application (requirements below) for the data which is in the following format:

### Data Model
#### Account
* `userEmail` (Account Holder email, unique)
* `balance` (the sum of the send and receive transactions, >= 0)
* `createdAt` (Account creation date)
* `updatedAt` (Account update date)
#### Transaction
* `userEmail` (Account Holder Email)
* `amount` (Number of tokens in transaction)
* `type` (Possible values: ['send', 'receive'])
* `createdAt` (Transaction creation date)

Transactions represent a change in the balance of an account - a `send` transaction removes tokens from an account and a `receive` transaction adds tokens to an account. \
A transaction can only be associated with one account. An account can be associated with many transactions.
Feel free to replace the userEmail field with an ID field or add ID's generated by your data storage method of choice.
Seeding data files are provided:
* [`accounts-api.json`](./accounts-api.json).
* [`accounts-api-large.json`](./accounts-api-large.json).
* [`transactions-api.json`](./transactions-api.json).
* [`transactions-api-large.json`](./transactions-api-large.json).

### Requirements
At a high level, you need to create an API for our internal team to manage the existing accounts and transactions, as well as create new transactions. \
To keep things simple, the data is not in "double entry" accounting format - tokens are added and removed from accounts by creating transactions via the API. \
The current balance of an account is the sum of all transactions for that account. \
Please use the data files provided to seed the database. No account in the seed data has a negative balance. \

We are mostly interested in the domain source code architecture - please do not worry about including infrastructure as code, containerization and networking, ci/cd, database sharding etc. \
No authentication or authorization functionality is expected in the submission. \

#### API Requirements

1. Get an account and its current balance.
2. Create `send` and `receive` transactions for an account.
1. No account should have a negative balance.
2. The `balance` field should reflect the sum of the send and receive transactions at all times.
3. Multiple team members may use the API concurrently.

Feel free to choose any tech stack that can accomplish the requirements. Although a similar stack to ours would be preferred.
Try to use fewer libraries and implement your own utilities and functionality. Avoid heavy/complex frameworks or reduce the dependency on them wherever possible.

### Time Estimate
Estimated effort to complete this challenge is 4-5 hours.

### Submission
1. Please host your repository on github and make it private.
2. Please include this README file in your repo.
3. Invite Ledn-Reviewer to your project once it is ready.
4. Email us to confirm that Ledn-Reviewer has been added as a contributor and your project is ready for review.

### Following Steps
Upon submission of the challenge, we will review your code and reach out to you with comments. If your submission passes our criteria, a following interview will be scheduled to discuss your implementation in further detail. We feel this is another great way to assess your understanding rather than on the spot coding exercises!

We want you to succeed as much as you do, so we wish you the best of luck! Looking forward to your submission!