Javascript Coding Interview Problems