I had to write my own tree traversal once. If I didn't know about trees, I wouldn't have had the basic context to do this.
But I did have to spend a few hours looking up and refreshing my knowledge of tree traversal. If I'd taken a technical interview exam on tree traversal prior to that four hours or refreshing my memory, I almost certainly would have failed. And yet I within the day I was able to write the code.
Agreed - my point is that I would be rejected from a job in the morning for an inability to write code that I'd be able to write by that afternoon.
They aren't testing whether you can look it up and do it, they're testing whether you have it all loaded into short term memory, on the spot.
Like a lot of people, I'm tired of having to reload it all and essentially retake my data structures exam. A lot of us just don't want to interview anymore. I know that if I need to, I can write a BFS or find all permutations of a set. If the opportunity is good enough, sure, I'll study up and get ready to do this at a whiteboard, but it's boring and unpleasant at this point, and I might not get or want the job, so at this point, I rarely bother.
Tech interviews are a big part of why tech companies are experiencing a "shortage" of applicants. They're hardly the only reason, but I'm pretty convinced they are a reason.
But I did have to spend a few hours looking up and refreshing my knowledge of tree traversal. If I'd taken a technical interview exam on tree traversal prior to that four hours or refreshing my memory, I almost certainly would have failed. And yet I within the day I was able to write the code.