Skip to main content

Getting Started with DSA for Beginners

· 3 min read
Suraj Jha

In this article, I will share my own strategy for getting started with DSA. I will share exactly how I started with 2 star at CodeChef and practiced to achieve 4 star in just 3 months. I will share aditional tips on how learning dsa will help you excell as a software engineer and help you land your first job!

Prerequisites

  1. Data Types, Variables, Loops and Conditional Statements
  2. Functions and Classes

Know Your Weapon

Before you start your fight, you need to make sure all your weapons are ready! Here Programming Language is your weapon. You can choose any programming language of your choice. My favourite weapon for DSA is C++. Every programming language has some sort of helper libraries like in C++ we have C++ STL and in Java we have Java Collections Framework. Similarly you need to find all sorts of available tools and libraries for your own favourite language.

Mastering Your Weapon

Once you are familiar with the features of your language, you need to practice how to use them. I would suggest watching any small course on youtube to learn how to use your language. For C++ STL Playlist by Luv and Complete C++ STL in 1 Video by Striver are good getting started resources.

Practice Practice Practice!

Remember, there is no better way than practicing problems on your own! You may struggle a lot if you only watch course videos and not use your own brain on problems you practice.

Getting Started with Logic Building

Now, that you are ready with your weapon, it's time to take your first shot! Go to LeetCode Problemset, filter by Easy problems and start solving sequentially!

Steps to practice effectively on LeetCode:

  1. Read the problem statement first: Understand the problem thoroughly before proceeding.
  2. Draft your logic: Outline your approach on paper or in your head before coding.
  3. Identify time and space complexity: Estimate the complexity of your approach.
  4. Search on YouTube if stuck: If you're unable to solve the problem or determine its complexity, look for solutions on YouTube.
  5. Learn unfamiliar topics: If the problem involves an unknown topic, study it before attempting the problem again.
  6. Code without referring to solutions: If you've already seen the solution, try to implement it from memory without looking back.
  7. Get the solution accepted: Submit your solution and ensure it passes all test cases.
  8. Review LeetCode discussions: Check the discussions tab for alternative approaches and new ideas.

Becoming Pro

Once you have confidence move to medium difficulty! Once you have enough confidence over medium start solving mix of medium and hard problems on LeatCode.

Testing your Potential

As you are good with practicing problems, it's time to test how you perform in pressure with time Constraints. Start attempting contests on palatforms like LeetCode, Codeforces, AtCoder, etc.