Javascript Algorithms Interview Questions