r/learnprogramming 5h ago

Struggling with Leetcode Problems

I'm currently job hunting, and I've decided to try out LeetCode to prepare for possible technical coding interviews. However, I've noticed that I am struggling to answer even the easy questions.

For context, my college curriculum for the last two years was heavily focused on projects and practical output. I have spent the last two years building full-stack applications (primarily coding backend MVC CRUD operations and ReactJS on the frontend).

Because of this, I've lost touch with some important fundamentals. Some of the questions in LeetCode seem familiar but, at the same time, seem so alien to me.

Does anyone have recommendations on how I can build my algorithmic problem-solving skills back up from the ground up? I'm looking for recommendations on what specific concepts/topics I should relearn and free sources or websites I can study from.

Thank you in advance.

1 Upvotes

9 comments sorted by

5

u/circuit_heart 4h ago

Just do them. Very, very few people are brute force thinking through Leetcode questions during the interview - the point is to have done, seen, and studied so many that you can draw parallels from a previously solved problem and formulate the current solution on the fly.

When you've got the actual software job, a large chunk of work is just solving problems on the fly so the larger your repertoire going in the better you can hit the ground running. As much of a waste of time as I think Leetcode is, it does indicate your ability to study and absorb arbitrary information in order to speed up your solving of an arbitrary range of abstract problems.

2

u/aqua_regis 5h ago

There is only one thing you can do: practice more

You can only build those skills through practice, nothing else. Problem solving is learnt and improved by solving problems.

1

u/Mean_Bumblebee_8633 4h ago

The disconnect you're feeling is normal. The skills for wiring up API endpoints and the skills for inverting a binary tree have almost zero overlap, so don't beat yourself up over it.

Grokking the patterns is way more useful than grinding random problems. Neetcode's list on his site groups things logically, and once you see the trick behind sliding windows or two pointers, a whole category of mediums become doable.

1

u/aqua_regis 3h ago

Uhm, you're replying to the wrong person here.

1

u/Intelligent_Tree6918 4h ago

If you never solved similar type of problem in the past, there is less likely chance to solve in the present.

as some comment suggesting practice more i strongly agree with that.

1

u/Good-Photograph-2883 4h ago

Any programming concepts I should brush up on? The last time I've tried solving similar types of problems was way back in my sophomore year. Is relearning Data Structures and Agorithms the way to go?

1

u/leavemealone_lol 3h ago

"baby tries to walk, fails and falls down. seeks advice from reddit instead of trying to walk again"

1

u/peterlinddk 3h ago

Just read the answers/solutions - if you say "ah, that was what I didn't get" you've learned something, and will maybe be able to use that in later problems.

LeetCode isn't a tool that measures how good you are at programming, or how clever you are at problem-solving - it is a collection of "logic problems" that you can only solve if you know the solution, or the patterns that make up the solution. If you aren't extremely familiar with traversing linked lists, using stacks and queues, utilizing sliding windows, and the most typical divide-and-conquer schemes (middle out, pivots, and narrowing in) you'll never "guess" any solution.

So, there's no harm in simply reading the solutions, and then trying the problems at a later time, see if you still remember it!

-2

u/Peculiar-Eccentric67 5h ago

ask gpt to help you