Currently, I am only going through Neetcode's roadmap. I have solved 40+ problems.
My process is:
I only read up theory related to the video in case its something I do not know about from before. Only for max 30 mins, so that I do not waste a lot of time reading up. My primary aim is to learn by solving problems.
I am able to solve some problems but I feel I still do not have the intuition for solving new problems.
My questions:
I'm going to make a LeetCode course relatively soon, but in the meantime, I recommend this: Effectively Learning Data Structures And Algorithms (DSA) For Software Engineer Interviews
For your process, I recommend being stuck on Step #3 for longer (15, maybe 30 minutes). Step 4 is where I think you can improve a lot as you shouldn't just get the entire solution. What you should do instead is open just part of the solution and push your brain to fill in the rest of the blanks. This is harder with video, which is why I think NeetCode is sort of overrated honestly. The LeetCode text answers are far better at being modular.
Should I be reading up on more theory before I start doing more of the roadmap? Maybe go through Neetcode's courses.
I wouldn't go through the theory first, unless the problem is completely unfamiliar to you. There are a few reasons why. it can be very easy to procrastinate because you get a false sense of accomplishment by just reading theory. Before you read the theory, I would try to struggle with a problem first. So, when you do read the theory, there will be more "aha" moments because you've found a more effective way to solve a problem compared to solutions that you thought of before.
Does it simply take solving more problems to build up the intuition?
To understand problems at a deeper level, it helps to connect different problems you've seen before with each other. It can be easy to fall into a trap of just memorizing solutions. I would try to go one step further to break down solutions into smaller chunks or patterns and connect the smaller chunks with smaller chunks you've seen in other solutions.
Should I try harder on my own before checking the solution video?
Yes, it might be worth it to operationalize what it means to try harder. You don't want to just stare at the problem for 20 extra minutes and hope that a solution suddenly appears out of the ether. I would try to write out, in pseudocode, 5 potential solutions that you could use to solve the problem. It doesn't have to be exact, but you want to have written down something. After you look at the actual solution, you can retrospect back on why each of your 5 potential solutions did/didn't work.
How did you build the intuition to solving new problems?
A lot of it is pattern matching. There are common components that make up a lot of solutions. If you can bucket a problem into a pattern, it can make a problem a lot more manageable. But, I will say that there are problems that are just completely out of left field. Sometimes you just get a tough draw. The best you can do is to communicate to the interviewer how you think about the problem, potential solutions, and why you think a potential solution is the best way to solve a certain problem.
Hi, I totally agreed with what Alex and Charlie mentioned above. Some of my thinking:
P/s: I worked At Grab before :)
Thanks for your answers Alex and Charlie. I will try to incorporate this feedback. I realise I am memorising solutions rather than trying to understand them at a deeper level.
hey OP, I see you are a mid level engineer. Is there any particular reason you are restarting DSA? I am a fresh grad and I have stopped pursuing DSA thinking it's too late lol. I am at a company where I am happy and my plan is to only apply to companies in the future that do not ask DSA. Alex has also said multiple times that Leetcode is not a very good use of time if you want to become a better SWE.
Just wanted to get your insights to see if I might wanna reconsider my decision :)
LeetCode in isolation doesn't make you a better SWE (as it's not true software engineering), but the tension is that a lot of the best companies (namely FAANG) require it to get in 😭. So LeetCode is often 1 step back (no growth, huge time spent) for 2 theoretical steps forward (getting into FAANG, which is generally great for career growth, especially new-grads).
The big thing that's changed recently though is the market - It is so, so bad for junior engineers in particular to break into FAANG right now. For those engineers, they definitely don't want to spend hundreds of hours only grinding LeetCode as it will likely not matter. That being said, if you are able to get a Google phone screen or something, you should definitely break out the LeetCode.
OP's situation is different as they have some experience already (seeing as they're mid-level), and they work at Grab, a company that's on the level of Big Tech (Grab has hired many great engineers from FAANG). So they are much better positioned to get Big Tech interviews compared to most SWEs, making LeetCode prep higher ROI.