When people started asking these questions, the whole point was to see how people reason about a new problem they haven't solved before. There are almost no work problems that require you to regurgitate something verbatim you saw on leetcode before.
It's seriously making me question the intelligence of these interviewers. Although at the same time I realize it's mainly just to arbitrarily whittle down the applicant pool to a smaller number you can interview in person.
I actually think interview questions that are more qualitative are worse. I have to freaking guess the "design philosophy" of the interviewer and cater to his viewpoint which is often pointless or just flat out wrong.
For example I tend not to prefer putting data into a class if it's not needed, but we had one interviewer who wanted all my logic as methods on a class even though it's fine to have functions operating on a data structure. Not a big deal either way right? But there it is... With the influx of candidates they measure this bs.