So I think it's actually evolved into a weird sort of test of conscientiousness. Originally the idea was probably that we will test people's abstract problem solving skills. Can they come up with a solution on the fly? Ok, now can they figure out any clever optimizations?
But at this point it is sort of expected that if you are interviewing with a FAANG you will be getting these sorts of questions (and they tell you that up front), so it becomes a sort of test of "is this person willing to spend 10 hours preparing for an interview"?