33 lines
1011 B
Markdown
33 lines
1011 B
Markdown
# Junior Backend Engineer Interview
|
|
|
|
Imagine that you're building a fintech system. You're now building a small microservice that allow people to send money to each other.
|
|
|
|
## Instructions
|
|
|
|
1. Checkout into a new git branch with name like `YYYY-MM-DD-nickname`
|
|
|
|
1. Navigate into any language directory you're comfortable with
|
|
|
|
1. Implement the `POST /transfer` API endpoint that allows you to transfer money from one account to another.
|
|
|
|
The account balance has to reflect the new balance after transfer for both accounts and the transaction has to be recorded.
|
|
|
|
Example request look like below:
|
|
|
|
```
|
|
curl -X POST http://localhost:3000/transfer \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"amount": 100, "sender": "1", "receiver": "2"}'
|
|
```
|
|
|
|
1. Implement a new API endpoint `GET /transactions` that shows all transactions in the system.
|
|
|
|
1. Commit & push your changes to the git upstream.
|
|
|
|
Bonus points:
|
|
|
|
- Implement the requests validation
|
|
- Handle errors appropriately
|
|
|
|
Good luck!
|