I solved 541 Leetcode problems. But you need only 150.

Sahil & Sarra · Beginner ·⚡ Algorithms & Data Structures ·3y ago

Key Takeaways

Shares experience solving 541 Leetcode problems and provides tips for using Leetcode effectively

Full Transcript

coding interviews are very easy that's what I thought when I went to lead code and attempted this Rotator here's my very first problem after spending six hours on it I had not written a single line of code I was extremely frustrated and went to the discussion section to read the most afforded solution another two hours passed and I could not even figure out why this solution works at this point my frustration had transformed into disappointment I somehow managed to put myself to sleep that night the next morning I went to a friend and asked him to solve the exact same question and that's when I learned something interesting about the human behavior if you cannot solve a problem you feel sad but if your friend solves the exact same problem in under 15 minutes you are heartbroken after facing many hurdles like that I managed to solve more than 500 problems on lead code and along the way I collected many amazing job offers today I'm going to share everything that I've learned in the process at the end of the video I'll also answer a very important question and that is how to know if you're ready for interviews at Big tech companies before you can even start on lead code you need to have a good understanding of data structures and algorithms I have already covered this topic in my last video which I'll link at the end once I finish the basics of DSA I went to the top interview questions on lead code there are exactly 150 problems in there and all of them are very important I recommend that if you are solving a problem which is outside these 150 problems make sure it's your 151st problem now that you know where to start let's discuss what's the right strategy to solve these problems I'm sure that you already know that all the problems on lead code are tagged easy medium or hard based on the difficulty level if you look a little closer at the rotatory problem which was my first problem on lead code it stacked as a medium difficulty problem starting my lead code Journey with this problem was my first big mistake I made two other mistakes that I'll share later in this video this problem was a mistake because if you're looking to stay motivated and actually improve your programming logic you have to start with the easy problems as you solve some easy problems you'll start collecting some tools for your toolbox and when you reach the medium problems you'll be able to use these tools to tackle them this approach has two major advantages one you will not lose your confidence like I did when I encountered my first medium problem the second and the bigger Advantage according to me is that when you solve the medium problems you will actually learn more from them let me explain what I mean by this imagine that you have not solved any easy problems and you try to solve a medium problem let's say you are not able to solve the problem and you look at the solution there's a good chance that you might not be able to understand the solution and even if you do it's highly unlikely that you will grasp all the nuances of the solution so having some easy problems under your belt is a must before moving to the medium problems let's go back to our top interview questions and sort them by difficulty solve these 37 easy problems before you move on to the mediums now that you know the high level lead code strategy let's take a little deeper and see how to approach any new problem and this is where you see a big difference between a newbie and a pro interviewee let me tell you how a beginner solves any new problem they read the problem statement and immediately start coding a solution what they don't understand is that we should leave multi-processing to the computers our brains are not built to think and code the solution at the same time in fact as much as the productivity gurus would like you not to believe this we humans cannot multitask our focus is like zoom lens of a camera we can zoom in to see that one thing or we can zoom out to see more things but we cannot do both at the same time if you don't believe me you can try out the selective attention test by Professor Simons on YouTube I will link it in the description if you are with me on this I would like you to break the process of solving a coding problem into two separate Steps step one is coming up with the solution in your head and step 2 is actually coding it up in the editor sounds obvious doesn't it well it's not that simple you see when most people are thinking about the solution what they are actually thinking about is how to code their solution and there is a big difference between the two to explain what I mean let's walk through this easy problem on lead code in this problem we're given the root node of two binary trees and you need to tell whether the two binary trees are the same you can pause the video here if you want to solve the problem yourself a beginner might look at the given function and start thinking about checking the value at the root node of both trees to see if it's the same in The Next Step they would start thinking how they can compare the value of the nodes to the left or the right of the root notes this way of solving might work for the CC problem but if you are doing this you are actually thinking about how to code the solution now I want you to forget that you know how to code just think about this given the root nodes of two binary trees what needs to be true for true for trees to be peace value of the root mode needs to be the same the left subtree needs to be the same and the right subtree needs to be the same once you see that the solution is just this one line of code where you check all these three conditions training your brain to differentiate between thinking about the solution and coding it up requires a lot of practice but if you practice enough you will reach a place where you just have to think about the solution once you have a clear solution the coding part will start coming naturally to you in my interviews I rarely spend more than 15 minutes writing the actual code most of my time goes into thinking about the solution so keep practicing it might take 100 problems for some and 500 for others like me but you'll eventually get there before we talk about how to know if you are ready for interviews let's talk about how to actually practice and this is where I made my second big mistake and that is I spent way too much time on one problem it was mainly because my ego was very high how am I not able to solve this easy problem maybe if I give it a little more time by doing this I would end up spending up to 3-4 hours on one problem in an interview you only get 45 minutes to solve a problem why should your practice session be so different in my opinion if you're not close to the solution in one hour you should give up and spend rest of the time on looking at the solution of others learning from them so go to the discussion section sort the solutions by most foods and read at least top three solutions I recommend three solutions and not just the top one because sometimes the top solution is Not Practical for the interviews try to understand the solution rather than memorizing it because you'll not be able to replicate the solution in the interview after understanding the solution come back to the editor and code it up yourself even if you think that you are writing the exact same solution that you just read do the speakers many times there are Corner cases that you will not be able to see by just reading and when you hit the test cases that don't pass you will appreciate the difference between less than less than or equal to much better but what do you do if you are able to solve the problem and this is where I made my third and the final mistake after solving a problem I would just move on to the next question and that is not the best strategy because your solution might not be optimal it might pass all the test cases but there still might be some better Solutions out there I recommend reading the top Solutions no matter what this is especially important if your solution is too lengthy and you think that you cannot solve this problem in the interview time in my opinion if you're writing a solution that is more than 20 lines of code there is a good chance that there is a better solution out there so there's no harm in learning from others many people ask me how to decide whether they are ready for coding interviews are 200 problems enough or should I do 500 to be honest it doesn't work that way in life it's less about how many problems you have solved and more about how good you are at solving any new problem I believe that we should answer this question from the interview standpoint an interview is usually 45 minutes long and in most interviews they ask you lead code medium problems accounting for the pressure of the interview and adding a buffer for the introductions if you can consistently solve lead code mediums in less than 30-35 minutes you are ready to go reaching this level on lead code is impossible if you don't have a strong foundational knowledge of data structures and algorithms to learn how I mastered data structures and algorithms watch this video my name is sahil and I'll see you in the next one

Original Description

1. How to use Leetcode effectively? 2. How to learn Data Structures and Algorithms? 3. How to use Leetcode solutions? 4. Whether to use Python for Leetcode? 5. How to crack coding interview? I will answer all these questions in this video. ► FREE resources: 1. Leetcode Top Interview Questions (150 Problems) - UPDATED: https://leetcode.com/studyplan/top-interview-150/ 2. Selective attention test: https://www.youtube.com/watch?v=vJG698U2Mvo ► For more content like this, subscribe to our channel: https://www.youtube.com/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_couple26/ ► For business inquiries, reach us on: powercouplejourney@gmail.com #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.
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Sahil & Sarra · Sahil & Sarra · 30 of 60

1 Product Management Internship - EASIEST Path to Become a PM
Product Management Internship - EASIEST Path to Become a PM
Sahil & Sarra
2 I Quit $200,000 Software Engineer Job at Amazon
I Quit $200,000 Software Engineer Job at Amazon
Sahil & Sarra
3 What do I do as a Product Manager? - Product Manager Role
What do I do as a Product Manager? - Product Manager Role
Sahil & Sarra
4 CHEAT SHEET that I Used to Crack Product Manager Interview at MICROSOFT
CHEAT SHEET that I Used to Crack Product Manager Interview at MICROSOFT
Sahil & Sarra
5 Why Tech Workers are Getting RICH💰💰 #shorts
Why Tech Workers are Getting RICH💰💰 #shorts
Sahil & Sarra
6 Why Is Everyone Quitting Their Six Figure Tech Job?
Why Is Everyone Quitting Their Six Figure Tech Job?
Sahil & Sarra
7 5 Years of Coding - Everything I've Learned
5 Years of Coding - Everything I've Learned
Sahil & Sarra
8 5 Highest Paying Tech Companies 💸💸 #shorts
5 Highest Paying Tech Companies 💸💸 #shorts
Sahil & Sarra
9 How I TRIPLED My Salary by Joining TECH
How I TRIPLED My Salary by Joining TECH
Sahil & Sarra
10 How I Became a Software Engineer Without a Computer Science Degree
How I Became a Software Engineer Without a Computer Science Degree
Sahil & Sarra
11 Top 5 non-CODING Tech Jobs that Pay $100,000+
Top 5 non-CODING Tech Jobs that Pay $100,000+
Sahil & Sarra
12 Top 5 Tech Jobs That Pay $100,000+ Without Coding
Top 5 Tech Jobs That Pay $100,000+ Without Coding
Sahil & Sarra
13 FASTEST Way to Learn Coding and ACTUALLY Get a Job
FASTEST Way to Learn Coding and ACTUALLY Get a Job
Sahil & Sarra
14 Coding Interviews Are Easier Than You Think
Coding Interviews Are Easier Than You Think
Sahil & Sarra
15 THIS is Why Software Engineers Make So Much Money
THIS is Why Software Engineers Make So Much Money
Sahil & Sarra
16 System Design Interviews are a SCAM
System Design Interviews are a SCAM
Sahil & Sarra
17 I got $50,000 more when I negotiated my tech salary
I got $50,000 more when I negotiated my tech salary
Sahil & Sarra
18 How I would learn to code in (If I could start over)
How I would learn to code in (If I could start over)
Sahil & Sarra
19 Google is not the best tech company
Google is not the best tech company
Sahil & Sarra
20 How YouTube is killing your programming career
How YouTube is killing your programming career
Sahil & Sarra
21 This is Why Your Resume Gets Rejected
This is Why Your Resume Gets Rejected
Sahil & Sarra
22 How I Hacked My Mind To Learn Coding
How I Hacked My Mind To Learn Coding
Sahil & Sarra
23 FASTEST Way to Learn Data Science and ACTUALLY Get a Job
FASTEST Way to Learn Data Science and ACTUALLY Get a Job
Sahil & Sarra
24 FASTEST Way to Learn Web Development and ACTUALLY Get a Job
FASTEST Way to Learn Web Development and ACTUALLY Get a Job
Sahil & Sarra
25 Why Most People FAIL to Learn Coding
Why Most People FAIL to Learn Coding
Sahil & Sarra
26 Google Engineer reveals his darkest secrets
Google Engineer reveals his darkest secrets
Sahil & Sarra
27 Become a better Programmer in 8 minutes
Become a better Programmer in 8 minutes
Sahil & Sarra
28 Start Behaving Like a Programmer
Start Behaving Like a Programmer
Sahil & Sarra
29 The Resume That Got Me Into Google
The Resume That Got Me Into Google
Sahil & Sarra
I solved 541 Leetcode problems. But you need only 150.
I solved 541 Leetcode problems. But you need only 150.
Sahil & Sarra
31 Why Good Programmers FAIL Coding Interviews
Why Good Programmers FAIL Coding Interviews
Sahil & Sarra
32 Can you solve this problem in one line?
Can you solve this problem in one line?
Sahil & Sarra
33 Puzzles for Software Engineers - Microsoft #1
Puzzles for Software Engineers - Microsoft #1
Sahil & Sarra
34 Puzzles for Software Engineers - Amazon #1
Puzzles for Software Engineers - Amazon #1
Sahil & Sarra
35 Layoffs = The END of Software Engineering?
Layoffs = The END of Software Engineering?
Sahil & Sarra
36 Puzzles for Software Engineers - Apple #1
Puzzles for Software Engineers - Apple #1
Sahil & Sarra
37 Puzzles for Software Engineers - Amazon #2
Puzzles for Software Engineers - Amazon #2
Sahil & Sarra
38 Puzzles for Software Engineers - Microsoft #2
Puzzles for Software Engineers - Microsoft #2
Sahil & Sarra
39 Puzzles for Software Engineers - Apple #2
Puzzles for Software Engineers - Apple #2
Sahil & Sarra
40 2-Minute Rule to Learn Coding - Atomic Habits
2-Minute Rule to Learn Coding - Atomic Habits
Sahil & Sarra
41 2 Minute Rule for Coding
2 Minute Rule for Coding
Sahil & Sarra
42 5 Math Skills Every Programmer Needs
5 Math Skills Every Programmer Needs
Sahil & Sarra
43 3 Developer Roadmaps That Actually Work
3 Developer Roadmaps That Actually Work
Sahil & Sarra
44 Cracked Google without a CS degree
Cracked Google without a CS degree
Sahil & Sarra
45 Top 5 Coding Languages To Get a Job
Top 5 Coding Languages To Get a Job
Sahil & Sarra
46 4 Reasons Good Programmers FAIL Coding Interviews
4 Reasons Good Programmers FAIL Coding Interviews
Sahil & Sarra
47 Reality of Software Development
Reality of Software Development
Sahil & Sarra
48 C is the grandmother of JavaScript
C is the grandmother of JavaScript
Sahil & Sarra
49 How to Hack Passwords
How to Hack Passwords
Sahil & Sarra
50 Learn Python with ChatGPT
Learn Python with ChatGPT
Sahil & Sarra
51 Learn Web Development with ChatGPT
Learn Web Development with ChatGPT
Sahil & Sarra
52 ChatGPT 2.0 aka GPT-4 is here!
ChatGPT 2.0 aka GPT-4 is here!
Sahil & Sarra
53 7 things I wish I knew in my 20s
7 things I wish I knew in my 20s
Sahil & Sarra
54 💸💸 $177,000,000 Coding Error
💸💸 $177,000,000 Coding Error
Sahil & Sarra
55 5 Google Search Secrets
5 Google Search Secrets
Sahil & Sarra
56 QWERTY Keyboard Slows Your Typing 🤔
QWERTY Keyboard Slows Your Typing 🤔
Sahil & Sarra
57 💰💰 Top 5 Highest Paying Jobs For Programmers
💰💰 Top 5 Highest Paying Jobs For Programmers
Sahil & Sarra
58 👩🏻‍💻 Top 5 Programming Languages
👩🏻‍💻 Top 5 Programming Languages
Sahil & Sarra
59 5 Steps to become a Full-Time Developer
5 Steps to become a Full-Time Developer
Sahil & Sarra
60 Coding is NOT enough
Coding is NOT enough
Sahil & Sarra

Related AI Lessons

Bloom Filters, Explained Properly
Learn how Bloom filters work and their benefits, including tiny memory and blazing speed, in exchange for potential false positives.
Dev.to · Daksh Gargas
Prefix Sums: The Preprocessing Trick That Makes Range Queries Instant
Learn how prefix sums enable instant range queries in arrays, boosting performance in various applications
Medium · Programming
I Thought I Was Ready for the Interview — Then One Simple Math Question Destroyed Me
A simple math question can destroy a developer's interview, highlighting the importance of being prepared for unexpected questions
Medium · Programming
Week 2(Day 10): LeetCode Two Pointers(slow & fast): Remove Duplicates from Sorted Array (Brute…
Learn to remove duplicates from a sorted array using the two pointers technique, improving from brute force to optimized solutions
Medium · Python
Up next
Stump Grinder Carbide Wheel Grinds Hardwood To Chips
Innoforge Studio
Watch →