News for hackers. Stuff that matters.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by Bahamut on Tuesday April 24, 2018 @01:37PM (#16914718)
To be fair, if you wanted to do a performant implementation, this is probably a more expensive implementation. The expected response is generally for you to iterate over the string and construct a count map of how many times a character appears in a string, and then iterate over the keys of that object and have at most one odd number in the values of the count map.

The interviewer probably should have probed you about performance though if their intention was to judge you on that (they're both O(n) time complexity, but split, reverse, and join are generally more intensive).

Re:Things I Learned from a Job Hunt for a Senior Engineering... by wheresvic1 on Tuesday April 24, 2018 @01:56PM (#16914901)
Err I always thought that the expected performant response is to have two indexes 0 and length-1 and bring them to the middle checking that the values are equal :)
Re:Things I Learned from a Job Hunt for a Senior Engineering... by glangdale on Tuesday April 24, 2018 @02:02PM (#16914971)
I'm very confused by this answer. Have I missed a joke? Wouldn't the expected response be to iterate over half the string comparing the characters to the other half (in reverse order)? The criteria you provide seems to suggest aabbc is a palindrome.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by Bahamut on Tuesday April 24, 2018 @02:08PM (#16915042)
Ah sorry, I misunderstood the question - the one I've seen usually is if a string could be rearranged as a palindrome ha.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by dlgeek on Wednesday April 25, 2018 @01:07AM (#16918754)
You're thinking of an anagram, not a palindrome.