r/javascript • • Jun 01 '15

The Art of Hiring Javascript Developers

http://www.zsoltnagy.eu/the-art-of-hiring-great-javascript-developers/
3 Upvotes

16 comments sorted by

View all comments

2

u/drowsap Jun 02 '15

longest palindrome is a really hard question to ask in an interview geared towards UI developers

1

u/rmbarnes Jun 02 '15

Depends. If they mean longest palindrome with any anagram of the given string, that's hard. If they just mean longest possible palindrome while maintaining the current character ordering, then that's fairly trivial. If someone can't code that I'd be worried about their level of competence as a JS developer.

1

u/zsolt555 Jun 02 '15

I meant the trivial task. It was originally specified in more detail, but after reading the constructive critics, I removed the task definition with about 1000 words of other fluffy stories. Lesson learned.

This is all I ask for: http://jsfiddle.net/4hj57yjs/. The interviewer would supply a possible implementation for the reverse method for strings to save time. The candidate would be allowed to look up how to create a substring from a string. We don't allow whitespaces, we don't care about efficiency, we don't go into algorithm theory and we don't place emphasis on the "cracking the code interview" types of questions.

Even though UI developers don't deal with palindromes, we still write functions of this complexity when displaying or serializing data. Therefore, the correlation is there.

1

u/rmbarnes Jun 05 '15

Even with having to reverse strings yourself (str.split('').reverse().join('')) it shouldn't take long, I think it's quite nice interview question.