What Jobs Can You Get Solving Easy on Leetcode

A better way to study and prepare for software engineering interviews

Person on laptop in bed

Photo by Ivan Samkov from Pexels

There's no way around studying algorithm questions if you want a high-paying job writing code.

Don't expect to cram it into the weekend before your interviews, either.

Several colleagues spent 3 -6 months grinding LeetCode questions before interviewing and getting hired by FAANG companies.

That said, you can spend months studying hard, or months studying hard AND smart. The latter will get you further.

You can't possibly practice and remember all 2,000+ questions on LeetCode. And even if you can, it's not the most efficient strategy.

Here are some tips for "grinding LeetCode" more effectively.

Don't Memorize Questions

Remembering questions and their answers might help you if you're lucky enough to get the same question in an interview.

This isn't impossible, as many companies are known to ask a small subset of questions.

But it comes with a few problems.

  • Memory can fail in stressful situations, like when three senior developers are watching you write code on a whiteboard.
  • Memorization doesn't always generalize well to slightly different questions.
  • You're likely to forget what you learned as soon as you stop studying.

Unless you know exactly what questions the company will ask, memorization is a suboptimal way to study. While it requires less thinking and planning, it requires significantly more brute force work.

Instead of memorizing specific questions, learn to identify different types of problems and sub-problems, and develop tools and strategies for each case.

Choose Questions Wisely. Don't Do Them All

Starting at the top and going through every question in order is rarely a good strategy.

Target a company

To start with, pick a few companies you'd like to work for, then investigate the types of questions they like to ask.

LeetCode allows filtering questions by company. For example, here are questions asked by Amazon. Amazon isn't the most straightforward case because the company is large, but many smaller companies ask a very constrained number of questions.

If your target company asks many array questions, it's in your best interest to be an expert at those.

Conversely, if your target company never asks graph questions, don't waste time on those.

While we'd all like to be well-rounded developers, studying for job interviews is a herculean effort, so narrow your studies as much as possible.

Target your weaknesses

Focus on the types of questions that stump you.

Interviewers will often help you if you've made partial progress on a problem. But it looks bad if you're completely lost on how to approach a question.

After 10–20 practice questions, you should have an idea of where your strengths and weaknesses lie.

At this point, take this opportunity to level up your weak areas. This may involve going back to the basics and brushing up on related algorithms and data structures.

While doing questions on a topic where you're already strong might feel good, you're better off focusing on areas where you're weak. Find questions where you've failed, and do similar questions to those.

The goal is not to study as many questions as possible but to be prepared. Choose questions wisely.

Don't Leave a Question Without Understanding It

If you're going to take the time to do a question, extract as much learning from it as possible.

In other words, if you can't solve a problem and need to refer to the question's solution, it's in your best interest to dig into that solution.

Understand why the top solution is most correct, and why the time and space complexity is what it is.

LeetCode problems often come with excellent video solutions that break down the problem and how to solve it. If you're just starting out, filter LeetCode for those questions.

Additionally, when you're struggling with a question, don't skip to the solution too quickly. Spend some time working on it, even if it takes you an hour to write a brute force solution with terrible time complexity.

Anecdotally, the answer will make more sense and stick with you longer if you've worked hard on the question beforehand.

Answer Questions on Paper First

Always start answering questions on paper. Never begin by writing code in your editor.

This is one of the biggest study hacks around, yet few developers do this.

In an interview, solving a problem conceptually is more important than implementing the answer in a specific language. Anecdotally, whether you write out the solution in Python or pseudo-code is irrelevant. The general logic and time/space complexity should be the same.

Secondly, coding the solution in an editor forces you to focus on the wrong things, like syntax and the language's functions, rather than the solution itself. Remember that code is the implementation of a solution, not the solution itself.

Finally, writing code on paper is more similar to a real white-boarding interview, so mentally, it's better practice.

While LeetCode does come with a built-in code editor for running your code, save this for a final check, after you've iterated on and manually reviewed your written answer for accuracy.

Use the Feynman Technique

Named after legendary physicist Richard Feynman this technique involves teaching what you've learned to someone else.

If you can't explain a solution, then you don't really understand it.

It's less important who you teach it to, and more important that you can explain it simply and with clear steps. So if you don't have a friendly developer, explaining it to your Grandma or dog also works.

During this process, you'll often stumble upon improvements, unfounded assumptions, or additional questions for yourself. Digging into these is what cements your understanding and further elevates you above simply memorizing an answer.

Additionally, you should try to explain the generalized idea behind the solution, rather than how to solve the specific problem.

If you can do this, you're ready to move on.

Conclusion

Answering algorithm questions in an interview can be daunting, no matter how accomplished you are as a developer.

That said, adequate preparation can mean the difference between getting the offer, and being told to try again in six months.

In my opinion, 50 hours of focused and strategic studying is more valuable than 100 hours of generic "LeetCode grinding." It's more work upfront and requires more thinking, but the struggle is worth the reward.

Several friends have received job offers from FAANG companies without any prior developer experience. So with the right plan and enough effort, you can also get your dream job!

What's your best tip for studying algorithm questions?

connlopery.blogspot.com

Source: https://betterprogramming.pub/stop-mindlessly-grinding-leetcode-study-smart-instead-8dd6ee6d8c23

0 Response to "What Jobs Can You Get Solving Easy on Leetcode"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel