I gotta ask... are companies you're interviewing with expecting you to have memorized particular algorithms? Or to be perfect with syntax?
In my most recent round of interviews, I found almost no one expecting me to recall a particular algorithm and implement it for a solution to a problem, but I did find plenty of questions that involved dealing with data structures, and writing my own code and algorithms to solve those problems.
Maybe I've been fortunate with not having been asked questions like "implement the quick sort algorithm"?
In this case it's a "distance between two employees in an org chart", which is basically a trivially modified closest-common-ancestor algorithm. The complication was that there was no ability to index into the tree at an employee and climb upwards, and they didn't want to incur the overhead of building that at the start.
That's fine in and of itself, but when I'm having a bit of a time pruning the common-ancestor paths, I want to use all 7 brain-registers for the problem instead of devoting 2-3 for communication, or, worse, having to flush everything from cache to analyze and respond to your "hint".
In my most recent round of interviews, I found almost no one expecting me to recall a particular algorithm and implement it for a solution to a problem, but I did find plenty of questions that involved dealing with data structures, and writing my own code and algorithms to solve those problems.
Maybe I've been fortunate with not having been asked questions like "implement the quick sort algorithm"?