My Brain after 541 Leetcode Problems

My Brain after 541 Leetcode Problems


My Brain after 541 Leetcode Problems

How to use Leetcode effectively? :    • I solved 541 Leetcode problems. But y…  

1. How to learn Data Structures and Algorithms?
2. How to use Leetcode solutions?
3. Whether to use Python for Leetcode?
4. How to crack coding interview?

I will answer all these questions in this video.

► For more content like this, subscribe to our channel:    / powercouple26  

► Follow us on Linkedin:
https://www.linkedin.com/in/gabag26
https://www.linkedin.com/in/sarrabounouh

► Let’s be FRIENDS! https://www.instagram.com/power_coupl

► For business inquiries, reach us on: [email protected]

#datastructures #datastructuresandalgorithms #leetcode #codinginterview

DISCLAIMER: All opinions shared on this channel are our own and don’t express views or opinions of our employers. We only use our experiences and public knowledge to make our content. NO CONFIDENTIAL INFORMATION of our employers is used or shared on this channel. This is not a Professional Coaching channel, it only highlights the public resources that have worked for our careers.


Content

0.089 -> I have solved 541 problems on Leetcode.
2.919 -> And it has completely transformed how my brain builds the logic to solve a coding problem
7.35 -> in an interview.
8.35 -> I went from someone who could not solve a simple array problem in one full day to someone
12.73 -> who recently solved 3 Leetcode medium problems within an interview of 45 minutes.
16.219 -> And let me tell you, there’s nothing special about me.
19.44 -> I just went through 5 levels of Leetcode grinding.
21.85 -> I solved 100 new problems at each level.
26.46 -> Each of these levels taught me different things and I made many mistakes along the way.
30.38 -> In this video, I want to share how my thinking process changed, interviews and offers I managed
34.52 -> to get and mistakes I made at each level.
37.27 -> In the end, I will also tell you if it was all worth it or not.
42.55 -> Let’s do this.
44.039 -> The year is 2016.
45.489 -> I have a good theoretical understanding of Data Structures and Algorithms after doing
50.27 -> Algorithms 1 by Princeton University.
51.64 -> But, I have no clue how to apply my knowledge to an actual interview problem.
55.65 -> I only know one programming language at this time, which is Java.
59.019 -> Filled with curiosity, I started solving Leetcode problems.
62.559 -> I spent hours solving even the easy problems.
65.129 -> I would often find myself staring at the screen, my mind filled with frustration and self-doubt.
70.15 -> It was a humbling experience, to say the least.
72.42 -> Java syntax, which I had learnt only recently, still felt confusing and unfamiliar.
77.27 -> Most of the time, I would just look at the solution after spending hours on it.
81.38 -> Instead of truly understanding the solution, I would try to memorize them, hoping that
85.45 -> somehow this would magically improve my logic building.
88.42 -> This was the mistake I made.
90.579 -> Another mistake I made at this level was that I did not have a clear structure to my preparation.
93.74 -> I would jump from one problem to another randomly, without any logical progression.
94.74 -> It felt like I was lost in a maze of algorithms and data structures, with no roadmap to guide
99.5 -> me.
100.5 -> As a result, understanding the problem itself became a challenge, as I struggled to make
104.25 -> sense of the requirements and constraints.
106.439 -> What frustrated me even more was that when I gave the problems that I could not solve
110.189 -> to my friends, they would come up with the solution in 15 minutes.
113.63 -> This made me feel dumb and I often felt like giving up.
116.409 -> But then I would remind myself how comparison is the enemy of progress.
120.04 -> So, I kept going and spent 3 months solving my first 100 problems, mostly easy ones.
125.289 -> I did not feel confident enough to apply for jobs at this stage and moved onto the Level
130.35 -> 2.
131.35 -> It’s at level 2 where I found myself being able to solve medium problems for the first
135.11 -> time.
136.11 -> These medium problems would often take me over 60 minutes and I could not solve them
139.97 -> consistently.
140.97 -> But, solving a medium problem every now and then gave me a lot of confidence.
144.31 -> The major reason I could not solve medium problems consistently was because I did not
148.19 -> have a clear boundary between thinking about the solution and coding up the solution in
152.43 -> my head.
153.43 -> Let me explain what I mean by this.
154.43 -> When the beginners try to come up with a solution, they are not thinking about the solution.
158.26 -> They are actually thinking about how to code their solution and there’s a big difference
162.67 -> between the two.
165.56 -> I will link this video at the end so that you can see it for yourself with the help
168.89 -> of an example.
170.069 -> Anyway, after solving some mediums, I felt confident enough to apply for jobs.
174.67 -> As a first step, I would get these online assessments where I would usually be able
178.49 -> to solve 2 out of 3 problems.
180.409 -> I could not crack any full time offers yet but I did manage to get an internship at level
184.851 -> 2.
185.851 -> Towards the end of level 2, I met a friend who gave this Longest Increasing Subsequence
190.38 -> problem.
191.38 -> When I could not solve the problem, he pointed out how I was missing important concepts like
195.42 -> Dynamic programming and Graphs from my preparation.
198.09 -> As a result, I had my work cut for Level 3.
201.87 -> It’s here that I started solving more advanced problems on Graphs and DP.
207.53 -> I could easily solve mediums within the time constraint of 45 minutes.
210.93 -> I was not only learning new concepts, I could spot the patterns and reuse them again and
216.06 -> again on different questions.
217.66 -> But there were still a few issues I had not managed to solve yet and this cost me one
221.61 -> of the biggest opportunities of my lifetime.
223.59 -> Right around when I had solved around 230 problems, my resume got shortlisted for Google
229.5 -> and I got an online assessment.
231.56 -> I passed the assessment and phone screen.
233.95 -> As the next step, I was invited to Google campus in Mountain View for the onsite interviews.
238.83 -> The interview was not as hard as I expected and I managed to solve most of the problems.
243.43 -> But, I still could not secure the offer.
245.53 -> That’s because the quality of my code was extremely bad.
248.37 -> Not focusing on code quality was the third mistake I made.
251.62 -> Bad code is a clear signal that you are a newbie and not ready to work on big codebases.
256.66 -> Another mistake I made was that I never focussed on debugging.
259.72 -> If my code did not work as expected, I would start making random changes with the hope
264.38 -> of making it work.
266.53 -> And this was an easy giveaway that I am not a seasoned programmer.
269.56 -> Anyway, all these were still easier issues to solve than this last issue.
274.02 -> Whenever I encountered a new problem, I would try to look for a solution that I already
278.19 -> knew and see if it works.
279.97 -> And this did not work all the time.
281.84 -> It was only at level 4 that I made a major change to the way I interviewed and managed
286.09 -> to solve this issue.
289.69 -> The major reason why I was not able to think from the first principles and looked for similar
293.56 -> problems that I already know was because I was spending too much time coding in the interview.
297.79 -> Here is what I used to think an interview should look like.
299.82 -> 5 minutes of meet and greet, maximum 10 minutes of coming up with the solution and 30-35 minutes
306.11 -> of coding.
307.11 -> I needed 30-35 minutes of coding because I was using Java in my interviews which is very
311.63 -> verbose.
312.63 -> And it’s very easy to make syntax errors in Java which can cost you a good amount of
316.199 -> time in debugging.
317.509 -> As a result, I was constantly under time pressure of coming up with a solution really fast to
322.389 -> have enough time for coding.
324.11 -> But that changed when I switched to using Python in level 4.
327.69 -> Switching to Python almost doubled my coding speed in the interviews because Python is
331.58 -> not only less verbose, it’s very intuitive to think in Python.
335.78 -> Having solved more than 300 problems in Java already, I was initially a little worried
340.14 -> about switching to Python.
341.22 -> But Python is very easy to pick if you already know any other programming language really
345.6 -> well.
346.6 -> Since I had more time to write code now, my code quality improved and I was less nervous
350.4 -> when debugging my code.
351.9 -> On top of this, there is one more thing Python did for me.
355.28 -> I was coming up with multiple solutions for the same problem.
358.36 -> Let me show you an example.
359.78 -> For this Combination Sum problem, I first came up with a backtracking solution.
364.35 -> But since writing code in Python is so easy, I could quickly test my DP solution as well.
369.25 -> In the good old Java days, I would probably not test different solutions that came to
373.21 -> my mind.
374.21 -> But with Python, I don’t even consider coding up the solution as an extra step for me.
378.37 -> So, it has allowed me to move really fast in my preparation as well as interviews.
382.63 -> I am probably overselling Python here but it has been a game changer for me personally.
387.47 -> Talking about the offers I got at Level 4, I got an offer from Amazon here.
392.33 -> This was early in Level 4 btw, before I switched to Python.
396.389 -> Level 5 is the grand climax of everything we have done so far.
401.99 -> You start encountering the same problems the second time and you redo them.
406.16 -> When you look at your old solutions, you laugh at them.
409.53 -> And whenever you can laugh at yourself from the past, you know that you are doing great
413.06 -> in life.
414.06 -> You can solve Leetcode mediums in 15-20 minutes.
417.03 -> Not only that, you can solve half of the Leetcode hard problems within 45 minutes.
421.8 -> Now, you feel invincible in coding interviews.
424.61 -> The question is not whether you can solve the problem in the interview, it’s how long
428.19 -> will it take you to solve the first problem and how many problems will you solve in the
432.78 -> same interview session.
434.37 -> Last time I was looking for a job, I could solve all the problems in the 35 or 40 interviews
438.73 -> that I did, except for maybe one.
441.06 -> The one I could not solve was an Apple phone screen and I managed to get to the next round
445.5 -> without completely solving the problem because it was a very hard problem.
448.79 -> Anyway, I ended up getting an offer from Google and that’s where I work right now.
454.759 -> The goal of telling you all of this not to flex or say that I am better than you.
458.84 -> The point I am trying to make here is that everybody starts from zero and struggles in
462.98 -> the beginning.
463.98 -> If I could go back in time to 2016 when I was at Level 1 and everyone else around was
468.37 -> better than me at problem solving, I would advise myself not to compare with others and
472.86 -> focus on my own journey.
474.639 -> Because once you go through this journey, it brings you a great sense of freedom because
478.2 -> no matter what the job market looks like, you will have the skills to get yourself hired
482.22 -> again whenever you want.
483.72 -> If you feel excited to start your own journey and want to know how to use Leetcode in the
487.629 -> most effective way, watch this video.
490.639 -> My name is Sahil and I will see you in the next one.

Source: https://www.youtube.com/watch?v=R_dJXNeQ-z0