Interview Coding Questions Javascript