r/codinginterview • • May 15 '20

Preparing seems tough

I'm not someone that I would call a beginner programmer, but no matter how hard I try to solve problems on leetcode, I get stuck and end up looking at the solution. And this has demotivated me beyond comprehension. I mostly code in python. I need to prepare for coding interviews and I roughly have 3 months at hand (along with attending classes, full time, at USC) Kindly help with some effective strategies of tackling problems

4 Upvotes

18 comments sorted by

2

u/wodahs1 May 15 '20

What level questions are you stuck on?

1

u/gpythonhead May 15 '20

I'm still stuck on easy level questions. Not too comfortable with them

1

u/wodahs1 May 15 '20

Are you a non-CS major?

You might need to look up some notes from CS classes.

1

u/gpythonhead May 15 '20

I'm a CS major🙈

1

u/wodahs1 May 15 '20

Oh are you a freshman? Have you taken courses on data structures and algorithms?

1

u/gpythonhead May 15 '20

I'm a first year Master's student. I've taken a algorithms class, but we mostly had to only write the pseudocode for the problems. I need to brush up on the coding part

1

u/gpythonhead May 15 '20

And I'm talking leetcode easy level questions

1

u/gpythonhead May 15 '20

I'm a CS major🙈

1

u/gpythonhead May 15 '20

I'm a first year master's student, and yes I've taken an advanced algorithms course. And I admit that I have to brush up on my fundamentals

1

u/bparanj May 15 '20

Why do you get stuck? Is it because you don't know the concept or you don't know how to apply the concept to solve the problem? Are you having difficulty with Python programming language constructs? Are you not able to solve the problem and come up with a brute force solution? Do you know the fundamental data structures and algorithms required to work through LC problems? How many problems on LC have you completed successfully? What level of difficulty ?

1

u/gpythonhead May 15 '20
  1. Don't know how to apply the concept to solve the problem 2)Not able to solve the problem and come up with a brute force solution 3)Have problems with the fundamentals

1

u/bparanj May 15 '20 edited May 15 '20
  1. Is it medium or hard problems? Can you do easy ones with no difficulties?

  2. Are you able to pick the right data structure?

Sometimes LC questions are ambiguous. So understanding the problems is half the battle. When you have problems with the fundamentals, you need to revisit them and study to gain a deeper understanding of the concepts.

1

u/gpythonhead May 15 '20

To be honest, I can't even figure out the easy ones, and if I do, the code isn't optimized... The running time is very high

1

u/bparanj May 15 '20

You probably want to split your preparation time: 70% study and 30% practice. Failing at the easy ones are fine. It acts like diagnostics to find your grey areas in fundamentals. Gradually, you will be able to start solving the easy ones, if you stick to your study/practice plan over a period of few weeks.

1

u/gpythonhead May 16 '20

That makes sense. I'm gonna take your advice and try this strategy out.. thanks for helping!!:)

1

u/jaspindersingh83 May 15 '20

We have some free classes at {S30} which can help you understand the basics of patterns.Feel free to DM.

1

u/fnbr May 17 '20

It’s a strange thing- it’s not (I would argue) related to your ability as a programmer, but a weird game. I’d read the Algorithm Design Manual and Cracking the Coding Interview- they helped me a lot with leetcode style questions.

1

u/fnbr May 17 '20

Also, figure out what the solution is to questions you’re getting wrong, learn that, and then run through that list of solutions for every problem you face. You’ll be surprised how similar the solutions are (a TON of them are graph traversal problems).