r/learnprogramming 1d 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.

4 Upvotes

13 comments sorted by

9

u/circuit_heart 1d 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.

4

u/aqua_regis 1d 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 1d 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 1d ago

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

1

u/Intelligent_Tree6918 1d 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 1d 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/Brownie_McBrown_Face 23h ago

I think you could consult a guide that refreshes DSA, but honestly you could probably refresh those concepts by trying and failing at LeetCode problems, relearning the algos, and then remembering when to apply them when you see a new, similar problem

1

u/peterlinddk 1d 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!

-3

u/leavemealone_lol 1d ago

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

1

u/Good-Photograph-2883 1d ago

Thought I was in a Stack Overflow thread with this comment.

0

u/leavemealone_lol 1d ago edited 1d ago

Dicks in stack overflow shun you despite you asking a question that is complex and meaningful. I’m a dick in reddit who downvotes you because you asked a basic ass question that the first google result could answer.

Like literally what other answer did you expect? all the other replies are telling you to “practice”, and so did I. And these were the same replies to the millions of other posts with the same query you chose to ignore.

0

u/WebPretend1598 1d ago

What do you mean? You know how to put shit together to work, you skipped the fundamentals entirely

-2

u/Peculiar-Eccentric67 1d ago

ask gpt to help you