Javascript Algorithm Interview Questions