X !== X is True. Tell me how?
Like seriously? I can't imagine a job that requires this knowledge. And the irony is, the interviewer is expecting the exact same answer that he knows. I would be really skeptical about joining a company who cares about such things.
Well, the answer is
NaN is never equal to anything, including itself.
But does this question really make sense? Will anyone ever use this in production code?
2. What is the fastest way to loop over a list?
I still can't get over the fact that it is one of the most repeated questions I've been asked. As simple it looks, as stupid it is. I don't understand the point of asking this question.
Another similar question is
3. Missing Context - Find problem in this code snippet question
The interviewer will throw a random piece of code and bluntly ask, what is wrong with this code snippet?
OK, I get it. You know something. But please don't put stupid tag on any candidate just because of this.
Instead ask, what is the most interesting tech challenge that you have solved. It would be entertaining and a good technical discussion for both.
I'll end my ramblings here but I'm sure some of you might agree with me on these points. If you have also faced similar interview questions, feel free to hit me up. I'm sitting behind email@example.com