Design an API endpoint that provides token information based on token title.
- the endpoint is exposed at
/tokens
- the partial (or complete) token title is passed as a query string parameter
q
- the endpoint returns a JSON response with an array suggested matches
- each suggestion has a name
- each suggestion has a symbol
- each suggestion has a address
- each suggestion has a decimals
- each suggestion has a total supply
- at-least 2 go-test needs to be implemented
- concurrency should be applied where appropriate
- feel free to add more features if you like!
- you have a list of tokens accounts defined inthe
addresses.jsonl
file that should be used as a seed to your application - we have included a
eth
lirbary that should help with any decoding and rpc calls
These responses are meant to provide guidance. The exact values can vary based on the data source and scoring algorithm.
Near match
GET /tokens?q=rare
{
"tokesn": [
{
"name": "RareCircles",
"symbol": "RCI",
"address": "0xdbf1344a0ff21bc098eb9ad4eef7de0f9722c02b",
"decimals": 18,
"totalSupply": 1000000000,
},
{
"name": "Rareible",
"symbol": "RRI",
"address": "e9c8934ebd00bf73b0e961d1ad0794fb22837206",
"decimals": 9,
"totalSupply": 100,
},
]
}
No match
GET /tokens?q=ThereIsNoTokenHere
{
"tokens": []
}
- All code should be written in Goland, Typescript or PHP.
- Mitigations to handle high levels of traffic should be implemented.
- Challenge is submitted as pull request against this repo (fork it and create a pull request).
- Documentation and maintainability is a plus.
You can find the necessary dataset along with its description and documentation in the data
directory.
We will use the following criteria to evaluate your solution:
- Capacity to follow instructions
- Developer Experience (how easy it is to run your solution locally, how clear your documentation is, etc)
- Solution correctness
- Performance
- Tests (quality and coverage)
- Attention to detail
- Ability to make sensible assumptions
It is ok to ask us questions!
We know that the time for this project is limited and it is hard to create a "perfect" solution, so we will consider that along with your experience when evaluating the submission.
You are going to need:
Git
go
To start a local server run:
go run ./cmd/challenger