由於第一份作業Refactor的時間會比較久一點,加上這份作業新版的有指定語言(TypeScript, NodeJS),現在會先分析review完所有作業再來做refactor。
Task: Crypto.com API Reconciliation
Given Candle Stick API , please design and develop a Java Application with JUnit5 unit test cases to verify the consistency of the output of Trade API
Hints for the Task
At minimum, we would like your solution to verify the consistency of the candlesticks in terms of
its attributes: O, H, L, C. Be careful on number handling. To verify consistency between a
1-minute Candle Stick Vs Trade, for a given minute:
a. If the minute has only 1 trade, expect O, H, L, C to be the same as the price of the trade.
b. If the minute has only 2 trades, expect that
i. O is the price of the first trade
ii. C is the price of the last trade
iii. H is the highest price from the 1st trade and 2nd trade
iv. L is the lowest price from the 1st trade and 2nd trade
To get started, you can start verifying the consistency of a 1-minute candlestick of BTC_USDT,
think about what the required data are to verify the consistency of the candlestick, and how to
obtain the data. To save time, you can verify the most recent verifiable few bars from the
candlestick.
You can think about how to generalize the program to handle different instruments / time-periods,
e.g. (5-minute chart, 15-minute chart, etc).
You are expected to handle / judge whether incomplete data is a real issue or you need to handle it.
Hints for the Code
Please focus on reusability, readability, scalability, and clean coding principles.
Provide sufficient comments where necessary.
Please feel free to use any third-party libraries.
Deliverables
Code and documentation, into a single zip file named <your_name>_software_engineer_exercise.zip
● Design and test cases
● Sample test run output
● Readme for installation / setup guide: Please use maven / gradle.
● Source code
● JDK 11 or above is required
建立一個Java應用程式來確認Trade API的輸出與Candle Stick API的一致性。
使用JUnit5進行單元測試。