Ultimately the problems boil down into a few "types". So you are memorizing the types.
https://dev.to/fahimulhaq/14-patterns-to-ace-any-coding-inte... https://neetcode.io/
After all, it has to be manageable for the interviewers to make sure all the questions are roughly equivalent in difficulty.
However, I have continued to solve 1 problem a night because what I realised is after 15+ years in the industry, I don't have a good grasp of some concepts anymore.
I'm slowly getting better at identify types of problems and apply what could be the most efficient data structure/algorithm in solving the problem. Once I solve the problem I go have a look at the solutions to see a more efficient way of solving it and try to store it away in my memory banks for another day.
The thing I don't like is when interviewer asks follow ups such as "Can you do the same solution but using O(1) space complexity". Unless the job has a restriction on running on limited hardware resources. I feel like it's unjustified asking such follow up questions because most of the time that is a very specific solution for the problem - or maybe I'm just not good enough to come up with such a solution yet.
But that's the problem. Why should they be hired?
The actual job will not consist of regurgitating those memorized solutions.
I'm impressed by someone who can memorize 2000+ solutions, same as I'm impressed by the acrobats at Cirque du Soleil, but I don't want to hire from either group for a software engineering job because that's not what the job is about.
I don't have a strong opinion either way, I got with the Leetcode grind program for my current position, but I really wonder about this: is it really possible to memorize these questions? Last I checked Leetcode has over 2000 questions, anyone who can memorize the solutions to all those is some kind of genius savant and should be hired anyway. Or is memorizing meant in a different context here?