Menu Close

How To Master Data Structures & Algorithms in 6 Simple Steps

data structures & algorithms

If you want to get good at Data Structures & Algorithms, then this article will be really important for you., I’ll outline 6 simple steps that I personally follow, every time I want to learn Data Structures and Algorithms.

This is not just cold blooded advice, this is something that I’ve followed since I started learning DSA for interviews. I cracked my previous & current companies through this process itself. This is actually something that’s worked for me.

And in this 6 step process, I’ll not include just the resources & tools, I’ll also tell you how to haveĀ  a proper mindset while starting out, how to manage your time properly, time management will be an important step especially along with development, and lastly, your revision strategy.

If you’re fine with HINDI, I’d suggest watching this video on my channel from which this article is derived. If you like it, I’d suggest subscribing to the channel as well šŸ™‚

 

1. Correct Mindset

What most I struggled with was, I used to do 3-4 questions, tried to do it daily. But once I wasn’t able to solve questions, I gave up easily. I just left it and never got around doing it. It was ok when it didn’t matter much, it when I realized it’s importance, I wanted to conquer this problem.

I figured out that if I wanted to learn DSA, I have to overcome this dejection and start solving more questions. So what I did was, I convinced myself that I would not expect any question to be solved for 1 month. What this did was it took away the burden of getting the questions right.

I wasn’t judging my self and hence could keep going on and on even if I was looking at solutions. And suddenly things started improving, I started seeing a pattern in questions and questions started getting solved. So I’d advise everyone to adopt this mindset and not judge themselves too early.

Look at the question, then try coming up a solution. Think for 30 mins. Then look at the hint, then take 15-20 mins. Then look at the solution and move on.

 

2. Good (Free) Lectures

I’m someone who understands well by listening to a lecture or a live example. The resource I would suggest here is not a hard line. Not necessary that you’ve to follow this. Follow whatever works for you.

This worked for me so I’m outlining it, and I’m not going to prescribe multiple lectures/tutorials since that only confuses people. This is my one and only go to resource to learn DSA, in-depth. That is MIT OCW 6.006.

This is a series of recorded lectures from MIT which is the best CSE university in the world. What can be better than this. This may feel slow for some users, but if you go through their lectures, you’ll know it’s worth it. Along with each algo, they do complexity analysis, space complexity analysis and in most cases, they give pseudocode as well.

Graphs were a difficult topic for me, but once I studied from there, it became so easy. I had to watch it 3-4 times, but was worth it. Although it’s 10 years old, but concepts remain the same. So go for it.

If you feel something else has worked for you, then mention that in the comments section so that others can benefit too.

3. Books

Now some people might understand better from books, so for those, I’m going to recommend 2 books. Although, I personally use them as a handbook. If I’m not able to understand a topic from lectures, I go to those books.

The first book is CLRS Introduction To Algorithms. It’s a bible for CS engineers. It’s a very thick very theoretical book which explains each topic in depth. I refer this if I’m unable to understand an algorithm or it’s complexity.

The other book is Cracking the Coding interview. I use this often for interview preparations. It’s kind of a question bank that one can refer to for good questions. It also has some company level advice that once can adhere to. Although you can find such advice from glassdoor as well nowadays.

4. Choosing the best coding platform

The best coding platform is the one which suits you the best. Whatever works for you is the best coding platform.Ā But if you ask me, the ones I recommend are LeetCode, HackerRank and InterviewBit. I’ll give my reasons for each one of them.

I like leetcode since it has topics explained very well with good amount of pictorial representation and theory. I especially liked their Recursion 1 & Recursion 2 tutorials. The best thing about them is that they have questions in increasing level of difficulty. If you’re studying a topic from there, they won’t throw the toughest question on you at once. It increases steadily.

I like HackerRank purely due to it’s UI/UX and Intellisense. Intelli-sense enables code completion in hackerrank.Ā And finally I like interviewbit for it’s structured roadmap. It gives a good roadmap of topics one can follow.

How I use them is, I look at the roadmap from interviewbit, suppose it’s time to learn likedlist after strings, so first I learn linkedinlist from leetcode, solve some questions there. Then I search for linkedin list questions on HackerRank and finally, I solve them on interviewbit, since interview bit questions are generally tougher.

Let me know which platform works for you in the comments below.

5. Time Management (Managing Dev along with CP)

I’ve created an entire video on this topic. I’ll link it in the description, but essence is, you’ve to do one thing at a stretch.

For example, you can do DSA on weekdays and Dev on weekend. Or vise-versa. If you want to do both, then you have to manage like this. If you’re only into DSA, then it’s not an issue.

But whatever you do, do at a stretch since you get into a zone. If you keep switching topics alternate days, there won’t be a continuity. You wont’ learn a topic in 1 day, so if you switch the very next day then you might forget what you’ve learnt in the other topic. So better to do things in a stretch.

This is one of the most asked questions on instagram DM as well. And I’ve not seen much conversation on this topic as well. This is a very prominent question especially in the minds of new college students. So I hope that this content helps some people.

6. Revision Strategy

Now it’s important to have a revision strategy in place if you’re not always doing DSA/CP. What works for me is, I identify good questions during problem solving. Then I either upload it to a github repository, or I just save it in a local folder in IDE.

This acts as notes too. I don’t need to take physical notes. If you prefer taking/writing notes, then it’s upto you.

See the thing about revision/note taking is it’s very personal choice. It purely depends on people to people. I cannot give an advice which just works for everyone. I like taking electronic notes, but someone might learn better by writing.

I can only tell you what works for me here, and it’s taking notes electronically, in IDE or pushing to github. This way, whenever I start preparing for interviews, I can just revisit that repo/that folder and quickly take a look at the most important questions along with their explanation and code.

These are the 6 steps I religiously follow whenever I prepare for Data Structures and Algorithms. Let me know in the comments section if these steps work for you. Also, if you think this video was helpful, do give it a like , it helps the channel grow. Also consider subscribing if you’d like to see more videos from me.