The unfair way I got good at Leetcode

Dave Burji
4 Dec 202306:46

Summary

TLDRThe script provides advice on effectively preparing for coding interviews. It recommends focusing first on learning common solutions rather than attempting to solve questions from scratch. This builds intuition within topics more quickly. It advises solving questions in an interview-style setting to practice split attention required in actual interviews. It notes the importance of quality over quantity in practice, focusing on foundational and common topics. It cautions against getting caught up in exotic solutions, emphasizing reasonable solutions that demonstrate competence. Finally, it encourages diligent, consistent practice over time to develop reliable interview skills.

Takeaways

  • 📝 Starting your coding interview preparation journey can feel overwhelming due to the vast amount of information available.
  • 🔥 Early on, focus on learning solutions to develop intuition for problem-solving, rather than attempting to solve questions immediately.
  • 🏆 Practice with a structured approach by categorizing questions into easy and medium, and learn common solutions before attempting to solve them.
  • 📈 Developing a deep understanding of certain topics can be more beneficial than trying to cover every possible area.
  • 🚧 Interviews are less about silently solving problems and more about actively engaging the interviewer with your thought process.
  • 📚 Quality over quantity: Focus on understanding common patterns and solutions rather than trying to solve as many questions as possible.
  • 🖥 Utilize resources like Pramp to practice technical questions in a more realistic, interview-like setting.
  • 📊 Interviews tend to focus on foundational topics like arrays, trees, and data structures over more advanced topics like dynamic programming.
  • 📖 Tailor your preparation to the company and role by researching and practicing questions posted by others from similar interviews.
  • 💻 Preparing for interviews with hiring managers should include understanding the company’s engineering challenges and weaving that knowledge into the conversation.
  • 👍 Consistent practice over a long period is key to becoming proficient in technical interviews; it's a marathon, not a sprint.

Q & A

  • Why is starting to learn coding for interviews described as difficult?

    -The difficulty in starting to learn coding for interviews stems from the challenge of being good enough to solve problems to land a job at high-paying companies and the overwhelming amount of information available, making it hard to know where to begin.

  • What strategy did the speaker use to improve at solving coding problems?

    -The speaker focused on learning solutions rather than immediately attempting to solve questions. This approach helped in developing intuition more quickly and solving questions faster within specific topics, like binary trees.

  • What method did the speaker recommend for learning about a new coding topic?

    -The speaker recommended starting with making two lists of easy and medium difficulty questions, learning common solutions well before practicing solving questions, and then moving on to practice with attention to new patterns or solutions for unfamiliar problems.

  • How does the speaker describe the experience of solving a question during an interview?

    -The speaker compares solving a question during an interview to acting on a stage, where the focus is on demonstrating problem-solving rather than quiet contemplation, requiring the sharing of thought processes and keeping the interviewer engaged.

  • What does the speaker suggest is necessary for effective interview preparation beyond solving medium-level questions?

    -Effective preparation involves practicing with distractions, similar to an interview environment, to get better at solving technical questions in an interview style. Utilizing platforms like Pramp for this practice is recommended.

  • What is the significance of the 'pyramid' mentioned by the speaker in the context of practicing coding questions?

    -The pyramid represents a structured approach to learning, where focusing on foundational topics (the lower building blocks) is crucial as they form the basis for understanding more complex topics and are more likely to appear in interviews.

  • Why does the speaker advise against focusing solely on finding the fastest or best solution to a problem during practice?

    -The speaker advises that the goal of practice should be to find a solution that will pass the interview, emphasizing consistency and effectiveness over finding the shortest or most complex solutions, which may not be necessary to secure a job offer.

  • How does researching specific questions posted by others benefit interview preparation?

    -Researching and practicing questions posted by others, especially those that have appeared in interviews with specific companies, can provide insights into what to expect and prepare for, as some questions may directly match those in actual interviews.

  • What is the value of understanding the company and engineering work before an interview with a hiring manager?

    -Understanding the company and its engineering challenges helps tailor the conversation during the interview, demonstrating interest and insight into the company's work, which can positively influence the hiring manager's perception and potentially secure the offer.

  • What mindset does the speaker recommend adopting for long-term success in coding interviews?

    -The speaker recommends adopting a mindset of consistent practice and patience, treating the learning process as a marathon initially and recognizing that becoming proficient may take a long time but will eventually transition into a sprint with sufficient practice.

Outlines

00:00

🌱 Starting Strong in Coding Interviews

The journey of mastering coding interviews begins with understanding where to start amidst the overwhelming amount of information available. Initially struggling with even basic questions, the narrator emphasizes the importance of learning from solutions to develop intuition quickly, especially in the early stages. By dividing practice questions into lists based on difficulty and type, and focusing on learning common solutions before attempting to solve more complex problems, the narrator found a more efficient way to improve. This method may seem controversial, but it's about building intuition and recognizing patterns, which is crucial for performing under the pressure of an interview where thinking time is limited and communication with the interviewer is key.

05:01

📈 Advanced Strategies for Coding Interview Success

Achieving success in coding interviews requires more than just solving problems; it demands a strategic approach to learning and practice. Emphasizing quality over quantity, the narrator suggests focusing on common questions and patterns, as well as practicing in conditions that simulate the divided attention of an actual interview. The narrator shares insights from personal experience, including the observation that questions on higher-level topics tend to resemble common practice questions closely, making familiar patterns invaluable. The journey from starting to excel in interviews is a marathon, requiring consistent practice and a mindset prepared for a long-term effort. Ultimately, the goal is to reach a point where interviewing becomes more like a sprint, thanks to the solid foundation built over time.

Mindmap

Keywords

💡intuition

Intuition refers to the ability to understand or know something instinctively without conscious reasoning. The narrator emphasizes developing intuition within a topic by learning common solutions thoroughly first, before trying to solve questions on your own. This allows you to recognize patterns faster and solve questions more efficiently during interviews.

💡interview

Interviews refer to the coding interviews candidates have to pass when applying for software engineering roles. The narrator notes that solving questions during an actual interview feels very different from solving them on your own, due to needing to share your thought process and keep the interviewer engaged.

💡patterns

Patterns refers to the common paradigms, themes, or approaches that come up repeatedly in coding interview questions. The narrator advises focusing practice on questions featuring the most frequent patterns, as these form the foundation for learning more complex topics.

💡roadmap

Roadmap refers to the structured learning plan the narrator recommends, where easier topics and common questions are mastered first before progressing to more advanced concepts. This exposes you to the patterns most likely to come up in interviews.

💡consistency

Consistency means regular, constant practice over an extended period of time. The narrator emphasizes that it takes consistent daily practice for well over a year to get truly proficient at coding interviews.

💡hiring manager

The hiring manager is the person who makes the final decision on whether to extend a job offer. Impressing them in a conversational interview, by demonstrating knowledge of their engineering challenges, can help secure an offer.

💡time

Time refers to both the preparation time needed to build skills through extensive practice, as well as the limited time available during a coding interview to analyze and solve a question under pressure.

💡solutions

Solutions refers to existing answers for coding problems. The narrator advocates learning common solutions thoroughly at first rather than trying to solve every question from scratch, in order to develop topic intuition faster.

💡pyramid

The knowledge pyramid represents how coding topics build on each other, with more fundamental concepts like arrays forming the base before progressing to more advanced areas like dynamic programming at the top.

💡adjustments

Adjustments refers to tweaks and modifications required in applying a coding pattern from a previous solution to a new, more elaborate problem. Even if the core approach is similar, new questions often require some tuning.

Highlights

Learning to code is challenging due to the vast amount of information and knowing where to start.

Initially struggling with easy questions, the speaker invested time and learned through mistakes.

Helping others pass interviews revealed that the initial struggles were part of getting started.

Emphasizes learning solutions and developing intuition for topics to solve questions faster.

Approach to learning binary trees involves making lists of questions and studying solutions before attempting to solve them.

Identifying new patterns through failed attempts helps in learning and moving forward efficiently.

Solving questions in interviews is likened to performing, with the need to engage the interviewer and share thought processes.

Reliance on intuition and familiarity with common solutions is crucial in interviews.

Practicing on platforms like Pramp to simulate real interview conditions is recommended.

The importance of both quality and quantity in practice, following a roadmap of common questions and topics.

Dynamic programming is less commonly encountered in interviews than questions on arrays, trees, backtracking, and priority queues.

Higher level questions in the pyramid of topics tend to be more similar to common questions.

The goal in interviews is to pass, not necessarily to find the best or fastest solution.

Researching and practicing questions posted by others for specific companies can be beneficial.

Preparing for interviews with hiring managers involves understanding the company’s engineering challenges.

Consistent practice is key to becoming good at interviews, with the process described as a marathon initially, then a sprint.

Transcripts

play00:00

lead code is hard not only because it's

play00:02

hard to be good enough to solve

play00:04

questions to land a job at a high-paying

play00:06

companies but also because it's hard to

play00:08

know how and exactly where to start when

play00:11

there is so much information available

play00:13

when I just got started I couldn't even

play00:15

solve an easy question well enough to

play00:17

pass an interview but I had no choice so

play00:20

I invested lots of time I made lots of

play00:22

mistakes but also learned a lot fast

play00:24

forwarding to today after passing many

play00:27

interviews and helping friends and

play00:28

random people who reached out to me on

play00:30

LinkedIn to pass their interviews and

play00:32

receive offers I realized that back then

play00:35

I wasn't bad I was just getting

play00:39

started especially in the beginning you

play00:42

should put more time into learning

play00:44

Solutions rather than solving questions

play00:46

so that you start developing intuition

play00:48

within that topic more quickly and then

play00:51

solve questions faster so for example if

play00:53

I'm now starting to learn binary trees

play00:56

instead of just choosing a list and then

play00:58

trying to Sol question by question

play00:59

question I would make two lists of easy

play01:02

and medium tree questions starting with

play01:04

the common ones and then I would

play01:06

separate each list again into two I will

play01:08

start with the first list and instead of

play01:10

trying to solve the question I will go

play01:12

to the solution and learn the common

play01:14

solution well after doing that for all

play01:17

of the questions in that list I will go

play01:19

to the second list and I'll start

play01:21

practicing when I land on a question

play01:23

that I could not come up with an answer

play01:24

for it can be a one-off or an outlier

play01:27

but when just starting it usually means

play01:29

that it's a new pattern I was not

play01:31

exposed to and I will learn that

play01:33

solution and move forward rather than

play01:35

wasting time on trying to solve the

play01:37

question I know this sounds quite

play01:39

controversial but give it a try and see

play01:41

if it also helps you get better at lead

play01:43

code much more efficiently which is what

play01:49

matters solving a question during an

play01:51

interview at least for me feels more

play01:53

like acting on a stage and the scene is

play01:56

that you solve a question rather than

play01:58

actually solving a question there is

play01:59

reason is is that you don't get to have

play02:01

even 5 minutes to think quietly and

play02:03

sketch some ideas you need to entertain

play02:06

the interviewer well not entertain per

play02:08

se but you need to keep them engaged

play02:10

share your thought process and walk them

play02:12

through what you're doing your attention

play02:14

is split which makes it really difficult

play02:16

to think that means I can only rely on

play02:19

intuition when I'm asked in the first

play02:21

few minutes I either know what the

play02:23

answer is thanks to something I've

play02:24

solved that is at least similar or don't

play02:27

and in that case I just try to get away

play02:29

with is asking the interviewer to have

play02:31

time to think and throw some ideas as

play02:33

they come until I land on something that

play02:35

might lead to a solution and usually

play02:37

interviews will also nudge you towards

play02:39

the right direction when you voice it so

play02:41

once you have practiced for long enough

play02:43

so that you're able to solve medium

play02:45

level questions if you stop there it

play02:47

will probably not be enough then you

play02:49

would need to practice on websites like

play02:51

pramp and start solving these questions

play02:53

when your attention is more split

play02:55

compared to when you solve questions on

play02:57

your own and get good at solving Technic

play03:00

questions in an interview style although

play03:02

over time the more you interview you

play03:04

will naturally get better at

play03:08

this it's not about quantity alone nor

play03:12

quality alone you need both quality

play03:14

means that you follow a road map that

play03:16

exposes you to the most common questions

play03:19

and topics to practice so that you have

play03:21

a sound starting point this way you can

play03:23

slowly work your way to expand the

play03:25

spectrum of questions that you can

play03:27

intuitively recognize you should spend

play03:29

your time to practice according to this

play03:31

pyramid focus on the lower building

play03:33

blocks since they are the foundation for

play03:35

learning the upper topics but also are

play03:37

more likely to be patterns for the types

play03:40

of questions that you will see during

play03:41

the interviews for example I've never

play03:44

been given a question on dynamic

play03:46

programming whether I interviewed at

play03:47

Fang a popular startup or a mid-tier

play03:50

paying company but I have been given a

play03:52

lot of questions on arrays similar to

play03:54

the common ones but somewhere on trees

play03:57

backtracking and priority cues something

play04:00

additional I've noticed during the 15

play04:02

plus interviews I've done is that the

play04:03

more the question you asked is higher

play04:06

into this pyramid the more similar it is

play04:08

to common questions in that topic so

play04:10

when I was asked a question on trees it

play04:12

was virtually identical to a common tree

play04:14

question of Thoroughly solved before

play04:17

which helped me to easily solve the

play04:18

question during the interview on the

play04:20

other hand when the question was on a

play04:22

raise it was more elaborate and not one

play04:24

to one something I've seen before even

play04:27

though it was sold using the same

play04:28

pattern from com questions from before

play04:31

it required more adjustments which is

play04:33

why sometimes being asked about less

play04:35

common topics can make things easier for

play04:37

you when you had practiced several such

play04:43

questions make sure that you're not

play04:45

solving questions for the sake of

play04:46

solving questions I know it sounds

play04:48

strange but when I practiced initially I

play04:50

got caught up with all the community

play04:53

trying to learn the best or fastest

play04:54

solution and so on but I was wasting

play04:57

lots of time when you interview the

play04:59

solution you need is the solution that

play05:01

gets you to pass the interview you do it

play05:03

consistently and that's how you land

play05:05

offers this rarely means having the

play05:07

shorter solution or an exotic one that

play05:09

is better time complexity wise than a

play05:12

reasonable common solution that is

play05:13

usually suggested to that question when

play05:15

you're interviewing there will be

play05:17

specific posts and lists sometimes even

play05:19

for smaller companies so research and

play05:22

practice these questions that others

play05:24

have posted I've seen more than once a

play05:26

question I was asked which was identical

play05:28

to a question someone else posted on a

play05:30

website like lead code or glass door

play05:32

with some companies you will have around

play05:34

with the hiring manager that will

play05:36

sometimes be technical but often will

play05:38

also include some of the high level

play05:40

related to what the company does when

play05:42

you know you have a around with the

play05:44

hiring manager do your D diligence about

play05:46

the company and their engineering work

play05:48

think about their challenges and things

play05:50

that they had to overcome and weave that

play05:53

in the conversation each time I had

play05:55

around with the hiring manager I could

play05:56

see how doing this at some point made me

play05:59

Vibe with the hiring manager and I could

play06:01

see how so long I don't do awfully on

play06:03

the technical questions I will have the

play06:06

offer finally just remember to give

play06:08

yourself time and consistently practice

play06:10

before you can really get good it took

play06:12

me well over a year of practicing each

play06:14

day with no exceptions to get to a point

play06:17

where I interview pretty well and can

play06:19

pass interviews when you start it's a

play06:21

marathon you will most likely also need

play06:23

to practice for a very long time at

play06:25

least if you're like me but afterwards

play06:27

it will be more like a Sprint where

play06:29

thanks to all of that practice you can

play06:31

recall and can quickly get in an

play06:33

interviewing shape when you need to with

play06:35

that said thank you so much for watching

play06:37

and I hope to see you in the next one

play06:39

[Music]

play06:45

bye