About a month ago I wrote a merge sort routine in JavaScript where the comparison function is a person. There is no library function for this, because the response is asynchronous.
> There is always a function for that in a high-level languages like Ruby (index), JavaScript (indexOf) or Python (index).
These functions don't do what your interviewers asked. Python's index won't give you duplicates, and it's at least equally non-trivial to use JavaScript's indexOf with two arguments in a loop as it is to use a hash, and the algorithmic complexity of the former is much worse, so why would you do it?
> Another sad thing, which I gladly didn’t see that much (but there still were a few interviewers) in the Bay Area compared to the East Coast, is asking terms, function names, definitions, slang, etc. Expecting people to remember functions’ syntax is a sin in itself!
On this point, I agree.