JhonelRios / videsk-hiring-test

0 stars 0 forks source link

Feedback tests #3

Open matiaslopezd opened 2 years ago

matiaslopezd commented 2 years ago

Hi @JhonelRios! I'm here to give my feedback on your test!

Test 1

Excellent :heavy_check_mark: very clean! šŸ‘šŸ»

Test 2

Excellent too :heavy_check_mark:

Test 3

First of all, congrats to make the bonus! šŸ‘šŸ»

Suggestion: In fact, you don't need to convert JSON into a string and parse it again. This consumes a lot of resources and its synchronous = bad performance because block the event loop. Imagine 500 array length with 1000 req/sec... šŸ’£

https://github.com/JhonelRios/videsk-hiring-test/blob/93bf60dafbd3132f1cb15a49be2049fedfb99a74/test3.js#L16 https://github.com/JhonelRios/videsk-hiring-test/blob/93bf60dafbd3132f1cb15a49be2049fedfb99a74/test3.js#L30 https://github.com/JhonelRios/videsk-hiring-test/blob/93bf60dafbd3132f1cb15a49be2049fedfb99a74/test3.js#L44

https://github.com/JhonelRios/videsk-hiring-test/blob/93bf60dafbd3132f1cb15a49be2049fedfb99a74/test3.js#L17 https://github.com/JhonelRios/videsk-hiring-test/blob/93bf60dafbd3132f1cb15a49be2049fedfb99a74/test3.js#L31 https://github.com/JhonelRios/videsk-hiring-test/blob/93bf60dafbd3132f1cb15a49be2049fedfb99a74/test3.js#L45

And as you see you have 6 lines repeating. Follow DRY programming! Same for formattedResponse.length === 0 conditional.

Congrats! šŸŽŠ

JhonelRios commented 2 years ago

Thanks for the feedback, @matiaslopezd šŸ˜„ I will fix the problems you pointed and keep improving my skills!