Do I need to learn every approach for Leetcode questions?
I’ve started working through NeetCode 150 to prepare for SWE interviews, and I’m a little confused about how I should be studying each problem.
For a lot of problems, there seem to be multiple approaches — brute force, a better/optimized approach, and sometimes multiple optimal solutions.
Do I need to understand and remember all the different approaches for each problem? Or is it enough to understand the brute-force idea and then be able to come up with/implement one optimal solution?
Also, if there are people here who interview candidates at Big Tech companies, I’d really like to know what you actually look for during these interviews.
Sometimes I come across a problem and think, “How would I possibly come up with this solution if I had never seen this problem or something similar before?”
Are candidates actually expected to figure out these kinds of solutions from scratch? Or is the idea that after practicing enough problems, you start recognizing patterns and applying them to problems you haven’t seen before? Cause I tried that and it sometimes does not happen.
For those who have successfully prepared for technical interviews/ who interview people at BigTech using LeetCode, what was your approach?
I’d love to hear how people who clear these rounds at BigTech approach this.
Thanks!