10 Best practices for learning data structures and algorithms (DSA)
Love it or hate it, but you can’t ignore it! Yes, I’m talking about DSA (Data structures and algorithms). If you’re starting with DSA or you’re someone who is stuck in the middle, here we present to you, 10 best practices for learning DSA because we want you to use your time efficiently ? and no, these are not some generic ones, these are well implemented best practices, and will help you sky-rocket your problem-solving skills.
Consistency
You’ve probably heard this one a lot but trust me this is the most important habit you need to uphill your skills. Solve at least 1-2 questions daily. Doing 30+ questions on a single day will do no good if you’re not consistent. Consistency will help you get comfortable with code and build muscle memory. Participate in daily challenges and hold yourself accountable. Once you’ve developed this habit there’s no stopping ?
Practice on paper
After reading the question, you should solve it on paper first. Dry running your code helps you to grasp the concept which is super important for interviews. Write every new concept that you learn, like new algorithms, ways of implementing a problem, etc, these come in very handy.
Use coding platforms wisely
Solving XYZ problems is not the goal, the goal is that you know the concept behind those problems, and you can solve them even if the interviewer molds the question a bit (and that’s what they always do). Even if you do a lesser number of problems but you know the implementation used in them, you’re going in the right direction. So, start with one concept, solve questions related to that concept, from an easy level, and eventually after some time, you’ll get to a point that easy and hard, these tags won’t scare you anymore.
Tick-tock ⏳
As a beginner, initially, your focus should be on problem-solving only but after a time, when you get a better hold at the logic building, you should time it. Install an extension or plugin, but allow yourself 40 to 45 minutes to solve a question. The interviewer will not allow you more time than that. Try to solve the question for 45 minutes and if you are not able to build the logic, peek into the discussion section, and try to do it on your own, if you still can’t do it then see the solution completely and understand the thinking behind the solution.
Discuss ?️
Don’t just move on to the next question after solving one. You should glance at the coding platform’s discussion section, especially the most voted ones. You will get to see so many new ways in which that question can be solved, expanding your thinking horizon.
Comments
Try to comment on your code, especially the important part. This will help you when you’ll revisit the problem after some time. Also, this makes your code clean, very important in interviews.
Ready..set..go!
Every beginner faces a problem that they’re not ready to solve the problems yet and they need to learn every concept of DSA then only they can start solving it. This is wrong on so many levels. As soon as you learn an algorithm or concept, start solving the questions, and participate in contests and daily challenges. Don’t make the mistake of sticking to so-called timelines. You cannot learn DSA in one or two months. It takes time to develop logic building which can be achieved by consistent problem-solving.
Thinking out loud
No! I’m not talking about the ?Ed Sheeran? song. When in interviews, it’s super important to explain your intuition about the problem, Interviewer might help you if you get stuck. You should be able to tell how did you reach that solution. Remember, it’s not only about solving the question, but it’s also about the concept. Take mock interviews with your friend to practice explaining your intuition or you can just pretend that you’re the interviewer and improve yourself accordingly.
Focus
Increasing focus is the most difficult thing and every person suffers from this. Solving problems in the early morning is a very wise habit you can develop as in the morning your mind is fresh which helps in focusing. Problem-solving is best done with a fresh and focused mind. Also, completing your daily questions in the morning itself will give you a sense of confidence and you can go on with your other tasks and come back the next morning 🙂
Keep learning
Understand that to master DSA, you need to keep solving problems consistently. You have to keep learning and documenting. There are no particular criteria that tell you that you know it all. So, just keep practicing. Even an expert will struggle to solve a problem if he hasn’t touched DSA for too long.
Bonus tip?
Don’t get too much hold on choosing your language and roadmaps in DSA. Just pick the language you’re most comfortable with and just start. Don’t hesitate to ask for help from seniors and mentors if you get stuck, they’ve all been there too.
Conclusion
We just learned 10 best practices for learning DSA. Hope you find this article insightful!
Happy learning!
Sharing is caring
Did you like what Vineeta Tiwari wrote? Thank them for their work by sharing it on social media.
No comments so far
Curious about this topic? Continue your journey with these coding courses:
7.76k students learning
Piyush Garg
Introduction to Data Structures and Algorithms
Prerak Mehta
Data Structures Algorithms in Java – SECRETS to Ace LeetCode