My two cents, but for these algorithmic questions the language shouldn't matter. Are you hiring someone deeply proficient in data structures and algorithmic programming? Then let them solve it in their language of choice.
If the role is JavaScript-centric, how about a question specific to the language like Describe the difference between var and let, and when you would use one over the other?
If the role is JavaScript-centric, how about a question specific to the language like Describe the difference between var and let, and when you would use one over the other?