Skip to content

Latest commit

 

History

History

bitcoin-tickers

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Challenge #1: Bitcoin Tickers

Bespoke Bitcoin Solutions Ltd. have hired you as an engineer for their new project. You are required to write an application to compare bitcoin prices.

Specifications

Write an application to consume from 2 REST APIs (documented below). These APIs will return bitcoin to currency prices.

You must compare the BTC -> USD exchange rate returned from each endpoint and output the lowest sell price to stdout. The output must contain the following:

  • Ticker Name.
  • BTC -> USD sell price.

Example Program Output:

Name=Blockchain, SellPrice=46920.61

or

Name=Bitcoin, SellPrice=46922.25

Endpoints

Below is information about the two endpoints.

Name URL
Blockchain https://blockchain.info/ticker
Bitcoin https://api.exchange.bitcoin.com/api/2/public/ticker

Blockchain Example Response

{
  "USD": {
    "15m": 47670.39,
    "last": 47670.39,
    "buy": 47670.39,
    "sell": 47670.39,
    "symbol": "$"
  },
  ...
}

Bitcoin Example Response

[
  ...,
{
    "symbol": "BTCUSD",
    "ask": "47514.89",
    "bid": "47511.47",
    "last": "47497.40",
    "low": "45080.00",
    "high": "48410.00",
    "open": "46976.00",
    "volume": "22233.49052",
    "volumeQuote": "1045074947.1505288",
    "timestamp": "2021-02-27T12:43:34.888Z"
  },
...
]

HINT: The ask price is the sell price in this response.

Rules

You will be scored on the following criteria:

  • Good use of design patterns.
  • Unit/Integration testing.
  • Code readability.
  • Code runnability.

The code will be pushed to a public git repo.

Other Rules:

  • Please only submit Java, Kotlin or Groovy code.

  • Please use Gradle or Maven, to make it easier for us to run your code.

  • Feel free to use any frameworks/libraries you like.

Good luck!