Helbiz - Full-stack technical test
This test is part of our hiring process at Helbiz for full-stack Software Engineering positions. There are three stages to this test, but you shouldn’t spend more than 4-6 hours completing it. And don't worry if you can't complete everything!
We would like to see how you architect a simple application that does three things:
- pulls data from an API that related to cryptocurrency wallets
- manages an internal balance system to transfer tokens between wallets
- reads from the Ethereum blockchain using web3.js, an open-source library
Your code will be interacting with our testing environment, so don’t worry about breaking anything! The goal is for you to show us your coding style, best practices you follow, and demonstrate an understanding of APIs and your framework of choice.
You are to use the API provided (2 endpoints) to retrieve a collection of wallets and render them for a user. For the first component, you only render the wallet addresses. Another component will allow you to filter the wallets with a radio button and utilizing the filter
API param. When you click on one of the wallets, display the information you retrieve via the /show
endpoint and render on another component.
Make your API requests to this URL, and make sure to set the authorization header!
API base URL : http://hbz-listen-test.us-west-2.elasticbeanstalk.com
Bearer token : HBZ90468f48ff6136f1
Get all the wallet records, or only those assigned to a user, or only those with a positive HBZ balance
PATH : /api/wallets
Method : GET
Params : filter [all|claimed|deposited]
Responses : 400 BAD REQUEST
, 200 OK
Example 200
response:
{
"filter": "all",
"count": 1,
"wallets": [
{
"_id": "5c0f...",
"public_key": "0x7233..."
}
]
}
Get the wallet record with the given _id
PATH : /api/wallets/show
Method : GET
Params : _id
Responses : 400 BAD REQUEST
, 404 NOT FOUND
, 200 OK
Example 200
response:
{
"public_key": "0x7233...",
"created_at": "2019-01-01T17:12:43.123Z",
"updated_at": "2019-01-01T17:53:59.158Z",
"balance_hbz": 1000,
"last_deposit_at": "2019-01-01T17:53:59.158Z",
"last_deposit_tx": "0x7233.."
}
Provide a simple form that simulates a transfer between two wallets. For input, you'll need the from
wallet address, to
wallet address, and amount
of HBZ to transfer. Persist these transfers using mongoDB and apply the transactions every time you pull data from the wallets API (again, consider an optimization strategy here). Remember to update the balances shown to the user.
Finally - our API is only returning the HBZ balance for wallets. We would also like you to use the web3.js library to retrieve each wallet's ETH balance and display alongside the HBZ balance. Read the API documentation to learn how to achieve this. All you need for this API is the wallet address.
Hint: To initialize the library, you need to set a provider:
- use library truffle-privatekey-provider as the provider
- Infura for the Ethereum client URL
- and set the private key (account has 1 ETH) to =>
76F6EC7EACC0F19FCA5CCB1D689A60B229327BF0C038119EE2BDFA2293236AFD
Bonus points: Initialize the library with a websocket provider and update the webpage with every deposit for both ETH and HBZ.
To start, fork this repository and submit a pull request with your finished app. We'll review and schedule a call so you can go over it with us. Be prepared to explain your code and why you made some of the decisions you made.