Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I like similar example: ["192", "168", "0", "1"].map(parseInt) which yields [192, NaN, 0, 1]. Makes a great question in the interview.


Personally if this was asked during an interview that didn’t allow looking up references, it would be a signal that the company is not a good place to work. It indicates the company places value on memorizing lots of programming trivia instead of valuing thoughtful research and exploring various solutions. Candidates may feel they are signing up for a brainiac contest.


It's the question to observe how candidate approaches this problem. It's not about receiving right answer.


Having written a book about JavaScript, I know the correct answer to this question.

Having also written a book about things to look for and abhor in an interview, I consider this question a strong red flag.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: