DEV Community

Cover image for How to actually start learning DSA?
Shivam Dhaka
Shivam Dhaka

Posted on

How to actually start learning DSA?

This was the question I used to find myself asking my seniors the most. I wasn't sure whether to buy a course or learn from free resources.

After going through various resources, I found a strategy that worked for me. And it's all free! 🆓💡

And if you are wondering, are there any prerequisites, check out this:

When to start learning DSA?

Now that you are prepared with the prerequisites, let's see how to actually start learning DSA. 📖📝


Theory 📚

Before deep diving into problem-solving, it is necessary to know the basics. Find out the answers to these questions before starting to solve problems.

  • What are Data Structures? 🗂️

  • What are Algorithms? ⚙️

  • Need for time and space-efficient algorithms in the industry. ⏱️📈

  • Time and Space Complexity. ⏰🧩

  • Big (O) notation. 📈🆒


Syllabus 📑

Knowing these topics will get you covered.

  1. Arrays

  2. HashMaps

  3. Sliding window and two-pointer

  4. Stack, Queue, and Monotonic Stack

  5. Searching

  6. String searching and Pattern Matching algorithms

  7. Heaps

  8. Intervals and Scheduling algorithms

  9. Bit Manipulation

  10. Recursion

  11. Backtracking

  12. Greedy

  13. Dynamic Programming

  14. Linked List, Cache algorithms

  15. Tree

  16. Trie

  17. Graph, Union Find, and Disjoint Set


Platforms 🌐

The most essential thing in learning DSA is solving problems. And you'll need a platform on which you can solve problems. Let's go through some popular coding platforms. 🌟🚀

  • HackerRank: This is the platform on which I first started coding. It contains beginner-friendly and descriptive type coding problems. Also, you can hone your programming language skills here.

  • GeeksForGeeks: GFG is another favorite for a lot of coders out there. It has improved a lot lately and can be a one-stop solution for you as it has various articles on almost every topic there is in DSA.

  • LeetCode: This is the most popular platform for practicing DSA problems. It has a large community that will help you a lot. And most of the questions here are asked directly in interviews. I'll recommend LeetCode without a second thought. 🌟🔥


Strategy 🎯

Now comes the most important part, what is the strategy you should follow for optimal learning. Let me break it down for you.

Pick a topic:

  • First, pick a topic (like array/stack and preferably in the order which I mentioned above). Then try to learn about that topic (theory) as much as possible from various sources. They can be books, MIT courses, YouTube videos, practically anything you like.

  • Once you feel comfortable with the topic on a theoretical level, explore some popular YouTube playlists around that topic and pick one. Watch it completely and make some notes (if you feel like it). After going through it, you'll know the standard questions around that topic that are generally asked in interviews.

Solving Problems:

  • Now that you have an understanding of the basics around that topic, it is time to start solving problems. But the question arises, which questions to solve as there are more than 2200 hundred questions on LeetCode. Here, DSA sheets save the day. You can search for different DSA sheets and choose one you like.

  • My recommendation will be Strivers' AtoZ DSA Sheet. This sheet nicely categorizes problems based on topics as well as difficulty levels. Here you can track your progress too.

Tips:

  • Keep track of questions you are solving and make notes of those questions. These notes need not be large, just 2 to 3 lines for a question that can summarize the logic used in the question will be sufficient.

  • Don't spend more than 30 minutes on a question if you don't have any idea how to solve it. After the first 30 minutes, see some hints and give another 20 to 30 minutes. Even if you are unable to come up with an approach, watch some YouTube videos of that question until the person describes the approach.

  • After that, try to code the approach yourself. After submitting the solution, review other solutions that performed better than yours and try to understand their approach.

  • Don't forget to revisit the questions you have solved previously, as you can start forgetting the questions you have solved before some time.

  • In the end, everything comes down to CONSISTENCY! Always remember, Consistency is the key. 💪✨

Be Consistent and Happy Coding! 🍀


My other popular articles:

When to start learning DSA?

Which langugae to choose for DSA?

Connect with me on LinkedIn for more content: [Shivam-Dhaka12](https://www.linkedin.com/in/shivam-dhaka12/

Top comments (0)