23 lines
1.4 KiB
Markdown
23 lines
1.4 KiB
Markdown
|
# Backend internal interview (rust)
|
||
|
|
||
|
## CHANGES: fixed branch
|
||
|
|
||
|
- Moving from **HashMap** to **BTreeMap** to preseve loading lines order.
|
||
|
- Fix **lines parser** in Maps **metrics** and in **aggregated_metrics** to be handled properly.
|
||
|
- Fix **unwrap / expect** for obvious reasons, add simple error message via **map_err**, **unwrap_or_else** and **closure function**.
|
||
|
- Fix some source code lines order, output format and conversions.
|
||
|
- Change some **iterators** to <u>functional mode</u>.
|
||
|
- Separate tasks to independent funtions for better isolation, less responsibilities and help on **tests** handling.
|
||
|
- Adding **output_path** to help on result output options.
|
||
|
- Following **unit tests** are implemented:
|
||
|
- <u>test_load_input</u> test load input file **input.txt**.
|
||
|
- <u>test_invalid_line_value</u> test use invalid value in line parsing.
|
||
|
- <u>test_invalid_line</u> test use invlid value in line parsing.
|
||
|
- <u>test_expected_metrics</u> test load input data from **input.txt** compare with **output_expected.txt**.
|
||
|
|
||
|
> Code simply **works as expected**
|
||
|
> It is not be able to **process multiple metrics in parallel** yet.
|
||
|
> A full refactoring has to be done for <u>better quality, maintenance and be more readable</u>. (Structs, implementaitions, settings for multiple inputs, etc).
|
||
|
|
||
|
Next round in: [Improve branch](/NewRelic/be-technical-interview-rust/src/branch/improved)
|