FAANG (& similar) have more applicants who can do the job than they have positions, so instead of checking for that and calling it a day, they filter for some combination of IQ and how bad you want it—willing to do a ton of otherwise-low-value prep work & practice, and to go through the painful interview process itself, likely several times at different companies, even for successful candidates.
The reputation of their interviews also means they likely don't get a ton of candidates who can't do the job. So they could likely just start randomly selecting from their candidate pool and do damn near as well as they do with all the interview effort—except as soon as that become known, they wouldn't be able to do that anymore. Plus they'd lose the hazing factor, which likely helps build company in-group identity. Having a lot of your employees feel like they only have their job because the finally got "lucky" in an interview may also help with retention, especially when everyone else who pays as much interviews in similar ways.
In a sense, being a huge, unpleasant waste of time is the whole point of their interview processes.
If you are talking about a self-balancing binary search tree, then, yeah, most people will have to memorize the implementation, as it would take much more than an hour to implement correctly. But if you are talking about plan binary trees, most good engineers will be able to write a simple enough implementation for the interview in a couple of minutes. And it won't be from memory, it will come from _understanding_ of how the binary tree is structured. The beauty here is that there is no need to memorize the implementation, as it is much easier to remember the definition of a tree and then write an implementation based on that.
An example of an extremely common question: “Write a function to check if a binary tree is a binary search tree.”
Yes you can memorize an answer here, and the implementation of a binary tree - I think most people just do that. Knowing the inns and outs of a binary tree is probably useful if you're writing a database, or a compression format. If they're hiring someone with the capability to write a database, or compression format, this question makes plenty of sense. It also makes sense if your criteria for hiring is "did they study and understand an algorithms course?". It doesn't make much sense if they're looking for someone who can do the actual job, in my opinion.