​https://github.com/aizatto/interview-preparation​
​https://github.com/trekhleb/javascript-algorithms​
​https://github.com/basarat/algorithms​
Maintain composure
Slow down
Control your excitement.
Carefully read the full question
Consider using one of:
Array
Linked Lists / Doubly Linked Lists
Maps / Hashes
Sets
Binary Tree
Binary Search
Recursive