
541 Leetcode problems are NOT enough.
541 Leetcode problems are NOT enough.
- 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. KPIs and OKRs: https://www.whatmatters.com/resources…
► 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.099 -> “One thousand five hundred eighty two”
- That’s the total number of Leetcode problems
3.79 -> it took for someone to crack Meta.
5.54 -> For most normal people like you and me, solving
so many problems on Leetcode is not possible.
10.36 -> Infact, in a recent survey that I conducted
on my Linkedin, only x% of people who responded
15.799 -> have solved more than 500 problems.
18.25 -> This brings me to one good news and one bad
news that I have for y’all.
21.72 -> The good news is that “Leetcode is not enough”.
23.9 -> You can easily do better than someone who
has solved more Leetcode problems than you.
27.44 -> The bad news is that “Leetcode is not enough”.
29.93 -> If you were thinking that solving a few Leetcode
problems is all you need to crack coding interviews.
33.7 -> Well, this video is for you.
35.8 -> There are so many other things that are equally,
if not more important than practicing leetcode
40.32 -> problems.
41.32 -> Let’s do this.
42.32 -> The path itself is the goal.
43.57 -> A coding interview is not just about solving
the problem, it’s also important how you
47.39 -> get there.
48.39 -> Take this example of a very famous problem
called “FizzBuzz'' which most of you can
52.14 -> easily solve.
53.14 -> You are given a number n.
54.25 -> For all numbers less than or equal to n, print
“Fizz” if the number is divisible by 3,
59.21 -> print “Buzz” if the number is divisible
by “5” and print “FizzBuzz” if the
63.3 -> number is divisible by both 3 and 5.
65.68 -> If none of these conditions are true, just
print the number itself.
68.69 -> Here is a very simple solution for this.
71 -> Go through all the numbers from 1 to n.
73.36 -> Check if a number is divisible by both 3 and
5, and print “FizzBuzz” if it is.
78.15 -> Otherwise, check if the number is divisible
by 3 or 5 and print “Fizz” and “Buzz”
82.4 -> respectively.
83.4 -> If none of this holds, just print the number.
85.82 -> To most people, this code would look perfectly
fine.
88.61 -> But, can you spot the problem with this code?
91.259 -> Pause to give yourself a moment.
93.47 -> If you look closely, the condition if the
number is divisible by 3 or 5 is being checked
97.979 -> 2 times.
98.979 -> Now, let’s say I change the problem from
multiples of 3 and 5 to multiples of 3 and
103.44 -> 7, you will have to change 5 to 7 at 2 different
places.
107.49 -> For a simple piece of code like this, it might
be ok.
110.549 -> But when you are working in big codebases,
this is not a good practice.
113.75 -> So, by asking a question as simple as FizzBuzz,
the interviewer can easily see if you will
119.729 -> be polluting their codebase.
120.729 -> A better way to write the same code would
be this.
122.89 -> Start with an empty output string.
124.61 -> If the number is divisible by 3, append “Fizz”
to it.
127.9 -> If the number is divisible by 5, append “Buzz”.
130.67 -> If the output is empty, set it to the number
itself.
133.9 -> And print the output.
134.9 -> In your quest to solve problems using Prim’s
algorithm, do not forget to write clean code
139.31 -> in the interview.
140.31 -> Always think about readability and maintainability
of your code and stay away from one liner
145.02 -> solutions.
146.2 -> Clarity of thinking and communication is another
thing that is very hard to learn from Leetcode.
149.94 -> I have kept clarity of communication along
with clarity of thinking because I believe
154.14 -> that you can not communicate effectively if
you can not think clearly.
157.879 -> The great American writer Mark Twain in a
letter to his friend wrote: "Sorry for writing
162.23 -> such a long letter.
163.35 -> I didn't have time to write a short one.".
165.39 -> Effective communication is always short and
simple.
168.84 -> Let’s take an example to understand what
strong communication skills look like in a
172.819 -> coding interview.
173.819 -> You are given a list of intervals that might
be overlapping.
176.099 -> You need to merge all the overlapping intervals
and return a list of non-overlapping intervals.
181.12 -> So, if you are given 2 overlapping intervals
like this, you need to return a list with
185.5 -> only one interval that has both the intervals
merged.
188.04 -> Let me give you a moment to pause the video
and think how you would communicate your solution.
192.49 -> Here’s what I would say: “I will sort
the intervals.
195.75 -> Then, I will start at the first interval and
keep merging it with the next interval until
200.019 -> I see an overlap.
201.019 -> When there’s no overlap, I will add the
merged interval to my answers.
205.31 -> And then I would do the same thing with the
next unmerged interval in the list.”.
208.989 -> By saying this, you have done 2 things: One,
you have painted a picture for the interviewer.
214.36 -> He knows what to expect when you start writing
the code.
216.76 -> Two, You have already made the code you are
about to write very clean.
220.7 -> You have said things like “I will merge
intervals”.
223.269 -> So, you will need a helper function to merge
intervals.
226.15 -> You also said that you will merge only if
you see an overlap.
229 -> So, you know that you will have a helper function
that will be called “can_merge” which
232.12 -> you would use to check the overlap of the
intervals.
234.409 -> Now, all you need to do is to put your code
where your mouth is.
237.87 -> Sort the intervals.
239.319 -> Start at the first one.
240.56 -> And if you can merge it, merge it.
242.62 -> If not, add it to the answer and do the same
thing with the next interval.
246.84 -> Clarity of thinking plus Clarity of communication
with Clarity of code, it’s a deadly combination
252.23 -> and no number of Leetcode questions can teach
you all three.
255.54 -> When I told you how I would communicate my
solution, there’s a minor detail that I
261.39 -> skipped.
262.39 -> I assumed that your interviewer can understand
and speak English as well as you expect.
265.92 -> Well, that’s not always possible.
268.02 -> Imagine that you get an interviewer with a
strong accent like me.
270.93 -> On youtube, you can just skip my video which
I do not recommend because there’s a good
275.24 -> chance your interviewer might have a similar
accent as me.
277.81 -> So, I recommend that you subscribe to the
channel.
280.9 -> Anyway, in such cases, you will have to find
other aids beyond verbal communication.
285.949 -> One of these can be Math as Math sort of is
a universal language.
289.479 -> You can also communicate via writing if needed.
292.05 -> Walk through some test cases in writing before
starting on the code.
295.46 -> Remember that in an interview, the onus is
on you to clearly communicate what you are
300.05 -> thinking.
301.05 -> I see so many people blaming interviewer’s
to further pump their already bloated egos.
303.83 -> Don’t do that, it will not help you in the
long run.
306.539 -> “Being present” is another thing Leetcode
can not help you with.
309.789 -> Imagine that you are working through your
solution to the problem.
312.289 -> And your interviewer thinks that there is
something wrong with the code you wrote.
315.28 -> But, you are fairly confident about what you
have done.
317.86 -> What would you do at this moment?
319.61 -> Well, interviewing is a collaborative exercise.
322.229 -> And you need to be present in the moment.
323.84 -> Don’t just go with your train of thought
and keep writing code.
327.1 -> Take pauses and address any questions the
interviewer might have for you.
330.75 -> Many times, the interviewers actually want
to help you when they ask you questions.
334.569 -> So, pay attention to your interviewer.
336.65 -> Another time you need to be fully present
in the interview is when your code fails to
339.729 -> compile or gives the wrong answer.
341.699 -> Pay attention to the error rather than just
copy pasting it on google.
344.056 -> Or doing some random changes hoping it would
fix the problem.
346.97 -> This is a sign of an inexperienced programmer
and it leaves a bad impression on the interviewer.
352.05 -> Use this as an opportunity to show your interviewer
how good you are at debugging.
355.789 -> If the interviewer likes your debugging process,
she would rank you as well as, if not better
359.86 -> than, someone who compiled and solved on the
first go.
362.62 -> Another thing Leetcode can not teach you is
how to talk about your past projects.
366.19 -> There are 3 key questions we want to answer
when talking about your projects.
370.539 -> What did you do, How did you do it and What
was the impact?
373.949 -> What you did is going to be a quick summary
of the project and why you did it in the first
377.96 -> place.
378.96 -> How you did it is where most beginners make
mistakes.
380.94 -> When explaining the how part, we want the
interviewer to feel 2 things.
385.05 -> One, they should be able to see that the project
was challenging.
387.93 -> Two, they should feel that the project had
a big scope.
391.31 -> It’s not always possible to achieve this
with every project but that’s the goal.
395.3 -> After establishing how you achieved the final
outcome, we want to make a strong statement
399.36 -> for the impact.
400.49 -> Many people completely miss this step.
402.29 -> Ideally, we want to talk about some key metrics
here.
405.02 -> These metrics are called by different names
like Key Performance Indicators or KPIs.
408.85 -> Or Objectives and Key Results or OKRs.
411.25 -> I will leave a link for you to learn more
about them in the description.
414.93 -> Having said all that, practicing interview
style problems on Leetcode is still the most
418.99 -> important step to crack coding interviews.
421.18 -> If you want to know the Leetcode strategy
I used to crack Google, Meta and Amazon, watch
425.639 -> this video.
426.889 -> My name is Sahil and I will see you in the
next one.
Source: https://www.youtube.com/watch?v=-zDry7Jkq8o