How to use Leetcode effectively

How to use Leetcode effectively

Every software developer has a dream to get selected for their dream tech company, and that brings us to Leetcode. It is one of the best platforms to master coding interviews and get selected for "MAANG" or other big tech companies.

Leetcode has a lot of great features and resources. I have been doing Leetcode for quite some time now and in this article, I am going to share my experiences and learnings to use it more efficiently and effectively.

Follow the right order

If you are just starting with the LeetCode, don't directly jump to hard questions. If you attempt a question and even after spending a lot of time you are not able to solve it, then it will be a little demotivating. Play it like a video game. I would suggest starting with easy problems. Once you get comfortable with it, jump to medium problems and then you can upgrade your level and go for hard problems.

Good Questions

One of the main reasons why people get bored with DSA is they do not solve the good questions. If you go to any question on LeetCode always look for the number of likes and dislikes. If the ratio of likes to dislikes is low, this does not worth your time, skip this problem. There are a lot of free resources are available on the internet to find good problems. You can find a good set of problems on neetcode.io. It has a great and organized collection of topicwise problems.

The right approach

Your solution is not the best and that is perfectly fine. First, try to solve the problem using the brute force approach, and then try to optimize it further. Also, don't directly jump to the answers, give it some time, and still if you are having difficulty solving it then go for the answers.

Generally what we do after solving a question is, we directly jump to the next question. That's not bad, but it is always good to go to the solutions(previously discuss) tab, sort it by most votes and try reading at least the top 4-5 solutions.

Dry-Run and Analyze

When you are solving a problem, don't directly jump to writing the code. First, try to dry-run the algorithm using pen and paper. Once you have understood the concept, the coding part will not be that hard.

Also, after solving any problem analyze the space and time complexity of your solution.

Contests

Contests are the best way to test your skills. Leetcode has weekly and bi-weekly contests. These contests will help you gain interview experience. You can also solve Leetcode's daily challenge question. It helps to maintain consistency plus you can also win some additional badges.

Stay Consistent

"Consistency is the Key". Stay consistent and try to solve at least 2 to 4 questions every day. It's always better to spend one hour every day of the week rather than spending seven hours on a single day.

That's it for today. If you think I'm missing any point, add your own suggestions in the comment section below.

Happy Leetcoding!!!