There are a bunch of subtly different ways to perform a coding interview.
If the interviewer points you at a whiteboard and asks you how to reverse an array, most likely they're checking you know what a for loop is and how to index into an array, and how to be careful of off-by-one errors. Even if your language has a built-in library function for doing this, they'd probably like you to not use it.
If the interviewer hands you a laptop with a realistic codebase on it and asks you to implement e-mail address validation, they're going for a more real-world test. Probably they'll be fine with you googling for an e-mail address validation regex, what they want to see is that you do things like add unit tests and whatnot.
Makes sense. I've never been asked to make such an exercise in real time, most of the time that would be a take home task - but I understand if someone wants to do that. Still it would be weird to demand that a candidate uses Google, wouldn't it?
I picked e-mail validation as an example precisely because it's something even experienced developers would be well advised to google if they want to get it right :)
Of course, if someone can get it right off the top of their head, more power to them!