Hoping to see familiar problems isn't the best strategy; it can be stressful. A better idea is to focus on mastering common problem patterns like two-pointer, sliding window, DFS, BFS, and others. With about 20 of these patterns under your belt, you'll be well-prepared for most challenges.
I agree with this approach. I cannot memorize solutions at all. I can however learn a few techniques and try to pattern match a given problem into those techniques.
I do admire folks that can memorize more than a few tens of problems though. It's a skill on its own!
I think everybody who intends to interview for a software engineer at a major company should, at least, have memorized a small collection of algorithms and data structures. For example, linked list, hash table, DFS and BFS, simple sorting. That means being able to explain the data structure with pictures or words, explain the basics of computational complexity, and write down the basic implementation in your language of choice.
If you don't bang out the right answers to those off the top of your head, all the programming interviews are going to be painful.
I have never implemented a linked list, a hash table, or a sort in $DAYJOB. I did them in school of course. After that I used what my development framework and libraries provided.
Yes, but would you forgo a well paying job because the interviewers asked you questions that weren't things you did as a day job?
The employers need metrics, fairly standard ones, to filter out unqualified employees and these sorts of simple algorithms and data structures are the least bad ones.
Where I complain is when the interviewer explains "to solve this problem, you need to think of them as virtual ants that can pass through each other" (yes this was actually what my interviewer said for https://leetcode.com/problems/last-moment-before-all-ants-fa...).
I'm guessing some do, the kinds of employers who attract a lot of applicants who misrepresent their education and experience.
I have never been asked to write code in a job interview. I guess I've been fortunate to find employers who look at my resume and talk to me as a person not a metric.
You generally have to use them, not implement them. Though a linked list is so simple that I think anyone calling themselves a programmer should be able to do it without any particular preparation.
>For example, linked list, hash table, DFS and BFS, simple sorting.
These are a given. You should know these.
When I said I cannot memorize solutions, I refer to memorizing solutions to specific Leetcode problems. Doing that for 1-2 problems per main area is doable, but anything more than that is quite hard.
True although maybe doing the top N problems for the company is a shortcut there. No point in spending a lot of time on a type of problem they will never ask.
2. memorize the top ten system design questions for the company you are interviewing at
^thats it, do anything else and you are wasting your time