I'm a student who has been practicing data structures and algorithms in Python. I've solved around 30 problems so far, mainly on LeetCode, but I haven't participated in any programming contests yet. I have about 40 days before a recruitment process begins and want to become comfortable with major DSA concepts, recognize common problem-solving patterns, and solve standard medium-level interview questions, including some competitive programming problems.
I currently follow the NeetCode 150 list instead of choosing random problems. However, when I return to a problem after a week, I often forget the approach and feel blank. I also make simple mistakes, and my solutions sometimes have poor time complexity. How should I structure my learning and practice so I can improve my speed, accuracy, and ability to solve problems independently?
3 Answers
Use the problem list as a guide, but focus on patterns rather than just counting solved questions. Group your practice into topics such as arrays and hashing, two pointers, sliding window, stacks, binary search, linked lists, trees, graphs, heaps, backtracking, and dynamic programming. For each problem, first spend 20–30 minutes trying on your own. If you need help, study the solution, close it, and then implement the idea from memory.
Keep a short error log after every problem. Write down the pattern, the key observation, the reason your first attempt failed, and the time and space complexity. Revisit the problem after one day, then again after three to seven days, without looking at your notes first. If you cannot solve it, review only the key hint and try again. This is more effective than repeatedly rereading complete solutions.
With only 40 days, prioritize interview fundamentals over trying to cover everything. Spend most days learning one pattern and solving a few carefully chosen problems, then reserve time for timed practice. Start doing mock contests or sets of two to three problems so you get used to working under pressure. Afterward, analyze every mistake, including skipped edge cases, incorrect complexity, and implementation errors. In Python, also practice using standard tools such as dictionaries, sets, heaps, deques, sorting with custom keys, and recursion carefully.

My biggest issues are making basic mistakes and ending up with solutions that exceed the time limit. I also forget the approach when I revisit problems later.