Tech IndustryMay 27, 2019
Chevronkuulcoder

Look at LeetCode solutions or not?

I’m studying for an interview for a few FAANG companies and some people say look at the solution when you’re first starting to get an idea for the next problem but in CTCI it says not to do that or it will ruin the experience. Some of the problems I flat out cannot solve efficiently and I get frustrated. Advice?

Nvidia JimTheTuna May 27, 2019

When I started leet coding, I was looking at solutions for most. Now I can almost get there, more or less figure it out, maybe I have a silly bug or something and I look at the answer to not spend too much time per question. But I’d say in the beginning, first 20-30 questions (whatever your range is), it’s prob okay to see solution. Then start really trying to come up with your own, at least brute force it.

VMware iterator May 27, 2019

How about peeking solutions for hard problems. I have solved around 100 easy/medium but still sometimes will have no idea how to approach a hard problem.

Nvidia JimTheTuna May 27, 2019

Oh yea f hard problems man. I almost always have to see solutions. Well I’ve only done like 12 of em so ..

Facebook ⭕w⭕ May 27, 2019

If you're drawing blank for over 10 minutes, admit to yourself how stupid you are, ask the leetcode gods for forgiveness, and peek at the solution.

Chevron kuulcoder OP May 27, 2019

Is it a sign I won’t ever make it past the interviews if I have these blank moments?

Intel CoryP May 27, 2019

You're going to have to do it so much it becomes second nature.

Evernote huhuhuh May 27, 2019

I disagree with CtCi in this case. You definitely shouldn’t just read questions and solutions and call it good. You need to practice them and simulate what it’s like to solve a problem with zero help. However if you have zero idea how to solve a question, you’re just wasting study time. Don’t forget there are hints so use those as well but I know for a lot of people there are a fair number of problems you don’t encounter in your day to day so its easy to forget how to solve them or even approach them. I would say in these cases it helps to go through the solution in detail, step through it and see how it works and then come back to the problem in a few days or better yet a similar problem to see if you could solve it on your own.

New
Bakii May 27, 2019

Look at the solutions and keep solving more you'll get better, don't listen to too many advices like ctci etc

Microsoft ghantaa May 27, 2019

Give each problem atleast 15 mins before reading the solution. Think about it from every angle and you could solve it. In my case, I found discussing problem with my friend/flatmate more helpful than looking at the solution. Takes more time but definitely more helpful.

Intel qmmm66 May 28, 2019

Screw ctci. Looking at the answers is fine by my books. The more you look the more patterns of problems you understand. And eventually you'll at least have the line of sight to solving new problems if not readily solve them.

Amazon sekuro May 28, 2019

Two things that I do when studying leetcode - When I get stuck with no progress for 20-30 minutes I look at the solution, then try to implement the solution without just copying it to enforce that I actually understand it. I then write the problem down and come back to it one or two times in the next couple weeks, especially if the solution looks like there is something I can learn and reuse in similar problems. Other than that try to focus on one subject at a time for a few problems to strengthen similar strategies through repetition.

Chevron kuulcoder OP May 28, 2019

Very helpful!!