Experience after 500 + LeetCode problem#
I stumbled upon a YouTube video by NeetCode today, where he shared his insights after tackling over 500 LeetCode problems. He candidly discussed a few missteps from his past and offered some valuable advice, which I've summarized below:
- Choosing the Right Language: NeetCode leans towards simpler languages like Python for coding interviews due to their efficiency. He doesn't particularly recommend C++ for this purpose.
- Sequential Problem Solving: According to NeetCode, problems should be approached in a certain order. For instance, one should master solving backtracking problems before moving on to Dynamic Programming, or tackle Tree problems before trying out Greedy algorithms. He even offers a handy roadmap to guide this process, as shown below.
- Don’t waste time sticking to a problem: he believes that each problem should be solved within 45-60 minutes. If you're stuck beyond this timeframe, it might be time to seek help from the provided solutions.
- Regular Reviews matters: The strategies and tricks behind each problem need to be reviewed periodically to reinforce your understanding. I think summarizing is the universal first principle of learning anything.
- LeetCode isn’t everything: there is a diminishing return from solving more LeetCode problems once you've reached a certain level of proficiency.
While I wholeheartedly agree with points 3, 4, and 5, the second point resonated with me the most, prompting me to pen this piece. It provided a heuristic for my learning journey, which is the most valuable information I got from this video.
But given my personal career of interest, I do most of my LeetCode problem in cpp. LeetCode helps me to get familiar with the std library as well as the language itself. Also, working with cpp is a inevitable fate of people working with robotics. I do think this is part of the reason I loving solving LeetCode problem daily.