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.