I do recall the last pair asked me to re-implement a java standard library functionality that was rather complex. It seemed out of place for an interview question.
While there are valid reasons to ask such questions they need to be framed carefully as to indicate why the developer would want to do so. Failing to do that causes frustration because in general the first rule is don't re-implement the standard library.
EX of good question: Facebook has their own COW C++ string with small string optimization because libstdc++ didn't used to have that. It can also provide massive speed improvements on multi-threaded code, what are some ways to implement this?
Ex of bad question: Implement a stringbuilder.