How to effectively use Leetcode in 2022!
If you’re someone who wants to land a high-paying software engineering job but, can’t figure out how to effectively use Leetcode, kudos, you’re at the right place!
When I first started my preparation, I was completely clueless about where to start! So, I feel you 🙁
There are tons of resources out there but still, we all end up asking, how to effectively use Leetcode/CodeChef/geeksforgeeks, so on and so forth…
I honestly never discovered Leetcode in the first place and wandered around other programming platforms which didn’t really suit me. However, once I discovered Leetcode, there was no turning back. This became my buddy and helped me land multiple offers from Goldman Sachs, D.E Shaw, Microsoft, and Innovaccer.
I am glad that after a lot of hits and trials I finally discovered some secrets that I couldn’t find on any blog or youtube video. And yeah, today, you will find those here!
So, without stretching it any further, here’s the flow of this blog:
- Should I do questions topic-wise (tag-wise) or randomly?
- How many questions should I solve for an effective use of Leetcode?
- Use this 4 step method for your best Leetcode outcome!
- Attend Contests
- Leetcode study plan
- Bonus Tip to effectively use Leetcode
- Final Thoughts
Should I do questions topic-wise (tag-wise) or randomly?
It’s always better to do questions without caring about the tag or topic simply because when you know the topic beforehand, your mind will work in a single direction. For example, if you saw a DP question, you restrict your thoughts and approach to DP even though you could have tried something else. That’s why it’s always recommended to pick up random questions irrespective of their tags to effectively use Leetcode.
But, this is not exactly how I proceeded when I started. So, when I started, I had no idea about any data structure or algorithms except the basics. And without a good handle on all the concepts, you cannot solve a random question thrown at you. Thus, I preferred a topic-wise approach first!
In a nutshell, if you are a newbie with cloudy concepts, first plan to do topic-wise questions. Devote some pre-decided time to every topic, and complete all the important concepts. Once that’s been done and you feel confident, start picking up random questions from Leetcode’s “Pick One” feature and brainstorm the solution.
How many questions should I solve to effectively use Leetcode?
This is by far, the most frequent query that I receive from students who are preparing for their tech interviews. And the simple answer to this is any number that makes you feel confident. It can be 100, 200, 300 or even a thousand! All that matters at the end of the day is, you acing up the interviews.
But again, does it have to be any number of questions, even as many as 1000 problems? Umm… probably not!
Here’s the thing: after starting your programming journey if you decide to stop the day you feel fully prepared, you probably are never gonna stop! So, you simply need to devise a strategy that will help you solve only good and important questions and save up your time from solving the unnecessary ones.
A few of the strategies can be:
- Start from easiest to hardest. You can move to the next difficulty level once you start feeling comfortable with your current level of questions.
- Start with problems that have a solution already provided by Leetcode. These are generally the most popular ones so, you simply can’t miss them!
- Start with problems that have good reviews. While LeetCode is a pretty great platform, not every problem can be the best. If you open a problem, you can see how many people liked or disliked a problem. I would recommend to initially stay away from problems that have worse than 2:1 ratio of likes to dislikes, and problems that have 4:1 or above are usually of fairly high quality.
Use this 4 step method for your best Leetcode outcome!
You know how to kick-start, Good! You know how to choose the right question, even better. But does that still guarantee you success? From what I’ve observed so far, there are many people who solve 100s of Leetcode questions but still end up struggling to clear interviews because they don’t follow the most important 4 steps while practising. And what those 4 steps are?
- Read the question properly:
This might seem obvious. But it plays a very crucial role in your ability to learn from the problem. When you read the problem, mark certain areas of the problem you think might be important. Take a note of what data structures/algorithms they might be hinting towards.
- Working on the problem
You should take 20–30 minutes for thinking about the approach of the solution and code it up. In case, you couldn’t come up with any approach, after a max of 30 minutes, you should be looking at your first clue and then brainstorm. If again in the next 10 minutes, you are not able to figure it out, look for a second hint and think for another 5 minutes (because by now, you should be able to figure out the solution). And finally, if it still doesn’t work, go straight to the solution, focus on areas you couldn’t think of, mark that question and come back later to revise!
- Review the solution
This step is also extremely crucial. Remember all the thinking you did in Step 1? This is where it comes into play. Look at the solution. What kind of data structures did they use. Was there a specific algorithm that you missed? Was there something that could have hinted at the steps they used? At what points did the solution diverge from what you had in mind? Such contrastive learning should be your goal. It will help you understand what areas you’re missing.
- Alternative solutions
This is a step that most people overlook. You got a solution accepted, and the solution seems pretty cool to you, great! What else is needed? However, you failed to realise, this is what makes the whole difference. Even if you have the optimal solution, I would recommend using some time to explore alternative solutions. Could we reduce the space usage (even if time complexity goes up)? Can we use other data structures/ frame the question in another way? What other ways could we solve it?
Contests are a really good way to assess yourself. It has all new questions and you’re supposed to solve them in a stipulated time period which prepares you for real coding interviews. So, make sure you never miss a contest!
Leetcode organises a contest every Sunday and every alternate Saturday. So, apparently, it’s not a big-time investment. You can easily manage 2–3 hours/week for these contests. However, I would suggest you to attempt contests more frequently if you really want that high-paying job. And for this, you should consider the “Virtual Contest” feature of Leetcode where you can maintain a contest frequency of every alternate day or every 2 days.
Leetcode Study Plan
Well, I already have shared with you how you can start solving questions topic-wise and later on, switch to picking any random one. But, you just can’t ignore the most famous questions’ list curated by Leetcode which has helped me too.
Now, a question might pop up in your head, “Isn’t it just easy to pick any list and solve all the questions in it?” No need to spend time figuring out if this question is worth attempting or not because the lists are meticulously curated anyway!
What I would suggest is: don’t go with any list when you’re just starting off. Follow the strategy of choosing good questions that I shared with you earlier and keep polishing your concepts. Then, just before the interviews, maybe 1–2 months earlier, check out the “Top interview Questions” List in Leetcode’s Explore section and try to complete as much as possible. It’s indeed a very useful list for interviews.
You can also consider following the study plans offered by Leetcode itself but why don’t I recommend these lists at the first place is because you’ll get less exposure to variety. However, you can definitely use them for brushing up before interviews.
Apparently, there’s no specific study plan that I can give you except some suggestions. Rest is your work to plan your study schedule, so don’t laze around on this!
Bonus Tip to effectively use Leetcode
How about finding out a friend who is as motivated as you are? You both can then devise a plan together and solve questions like a little competition on who solves more! You can also plan mock interviews on platforms like Pramp or Interviewbit and rate each others’ strengths and weaknesses.
Now, if you have a friend it’s good but if you don’t have one you might wanna try this small trick that I too had tried out. I used to regularly post solutions to the problems that I solved on Leetcode Discuss and gradually people started noticing me. Many reached out to me on LinkedIn inviting me to become their programming buddy. And finally, I came across this one person with whom I solved many questions, did mock interviews, built projects, and shared Leetcode premium too 😛
I have already shared all the answers you were looking for in detail and you simply don’t need to go anywhere else. But one tip from my side: just start off! Stop looking for answers even before starting off because once you enter the game, you’ll eventually find your way out.
Best of luck and Happy Coding! ❤