This is a take-home test for candidates applying for a full-stack developer position at BCW Technologies. It contains three sections: "Frontend" and "Backend" which together include a series of tests involving React, Typescript, and Node.js.
Feel free to solve these questions however you see fit, using whatever coding style or third-party libraries you think are appropriate.
To start the test, simply clone this repo and make your edits locally. Once you are done, please push your changes to this repo and create a pull request.
NOTE: We expect more than one commit in the PR, do not spend time overthinking the commit messages or squashing your commits together.
For the frontend portion of the test, use the /frontend
folder. There are 7 features we'd like to add:
-
Fetch and display the list of cryptocurrencies available from CoinStats (see endpoint below).
-
Create a responsive layout that will display these currencies and their respective image, URLs, and data.
-
Add a dropdown menu to fetch the list in one of the following currencies: HKD, KRW, SGD, and USD.
-
Add a button to sort the list of currencies by the rank of the currencies.
-
Add a button to sort the list of currencies by alphabetical order using the name of the currencies.
-
Add a field to display the exchange a user should use to minimize the amount of a selected currency they would need to spend on a trade
6a. selected currency is the currency the user has selected in #3.
6b. The correct exchange(s) should be returned by the backend server you are tasked to create below.
-
Please make the app be served on port
:3000
. -
Please use React-Typescript for this task, but feel free to structure the code however you prefer and use any other third-party libraries at your discretion.
-
Do not spend too much time making it beautiful. Basic aesthetics are expected, please try to balance your time between function and aesthetics.
-
CoinStats Public API
GET /public/v1/coins
endpoint: -
Parameters:
currency
:string
- one ofHKD
,KRW
,SGD
, andUSD
.
-
Example:
curl --location --request GET 'https://api.coinstats.app/public/v1/coins?currency=USD'
For the backend portion of the test, use the /backend
folder. Feel free to structure the code however you prefer and use third-party libraries at your discretion. We'd like to write some code that achieves the following:
- Create a JSON API (REST or GraphQL) using Node.js which will return which cryptocurrency exchange a user should use to buy a cryptocurrency to minimise the amount of the selected currency they would spend on this trade.
- You'll need to filter out
pair
s that do not support the selected currency. - You may perform this operation once per query, or once for each cryptocurrency - you may need to justify your decision at a later time.
- If only one exchange supports the selected currency, you can simply return that exchange's name.
- You should use the following CoinStats endpoint below to help achieve this task.
NOTE: Please make the server listen on port :4000
.
-
CoinStats Public API
GET /public/v1/markets
endpoint: -
Parameters:
coinId
:string
-
Example Request:
curl --location --request GET 'https://api.coinstats.app/public/v1/markets?coinId=bitcoin'
-
Example Response:
[
{"price":57000,"link":"https://www.kraken.com","exchange":"Kraken","pair":"BTC/USD","pairPrice":57000,"volume":161168912.22402},
{"price":56915.26,"link":"https://gemini.com/","exchange":"Gemini","pair":"BTC/USD","pairPrice":56915.26,"volume":64963739.7345771}
]
-
Request:
curl http://localhost:4000/exchange-route?coinId=BTC¤cy=USD
-
Response:
{
"exchange": "Kraken",
}
or...
-
Request:
curl http://localhost:4000/exchange-route?¤cy=USD
-
Response:
[
{ "coinId": "BTC", "exchange": "Kraken" },
{ "coinId": "ETH", "exchange": "Gemini" },
]
The test contains a basic docker-compose.yml
file. It uses the latest official NodeJS
Docker image and creates two containers - one for backend and one for frontend.
The respective folder is mounted in /app
directory inside the container.
It isn't a requirement to use Docker, but may be convenient.
Once you've completed the test, please send a pull request to the same repository.
Do not include node_modules or .git in your submission.
We will then review it and get back to you as soon as possible.
Thanks!