My DSA Journey and Strategy !

Anupam
3 min readAug 1, 2022

--

I am an ECE student from IIIT - Allahabad (2019–2023). I am a 6 star coder on Codechef(2257) and Expert on Codeforces(1622). I did my Summer Internship (May 2022 — July 2022) at Oracle.

I started DSA in 2nd Semester of my college. First i learned C++ language as I was already familiar with C. Most of my time initially was spent on researching what to learn and from where. Then I started solving questions on hackerearth, back then i was not even able to solve easy level questions. I used to apply the very basic brute force i could and due to this all my solutions resulted in TLE. I remember I started with the 1st topic array and not able to solve the easiest question on Hackerearth for array. Then while seeing one solution I got to know that there is something like STL in C++, I went on various sites and read about STL as much as I could. It helped me a lot in writing shorter code. I solved around 200 problems on Hackerearth of various topics and difficulties. Hackerearth contains list of all the important Data Structures and Algorithms which is really helpful.

Then one of my friend suggested me to give contests on Codechef and Codeforces. When I started giving contests on these platforms I was not able to solve more than 1/2 questions. It was so demotivating at times to be not able to solve questions in the contests. But after every contest I used to see the editorial of all the questions and every time i saw a Data Structure or an Algorithm I didn’t know about I used to go on Hackerearth/ Cp Algorithms/ Youtube/ GFG and read about it and tried to implement it on my own afterwards. That’s how I got to know about so many new topics in competitive programming. According to me this is necessary if someone wants to improve their rating and get better. Eventually after giving many contests I was able to solve questions in contests.

I also solved a lot of questions on Leetcode, GFG and Interviewbit. Codechef and CF helped me in improving in thinking fast and writing better and optimised code, these 3 sites helped me in improving my DSA logic which is important for interviews. My strategy for these sites was simple, select a topic I want to solve then go and solve easy, medium and hard level questions on that topic (Typical Ratio of number of questions according to me would be 3:5:2). After solving any question I used to see the editorial and best submissions of that question to learn optimised/ best/ fastest ways and techniques to solve the question.

Now, doing Codechef and Codeforces is not important for clearing Interviews but they taught me how to think faster under pressure and write the most optimised solution for a given question. Their contests feels like mock Online Assessments and Interviews for companies. Plus their rating helps in getting referalls for Product Based Companies.

Placement Topics :-

  1. Data Structures :- Array, Matrices, Stack, Queue, HashMap, LinkedList, Trees, Priority Queue, Graph, Trie, DSU.
  2. Algorithms :- Binary Search, Sorting Algorithms, KMP, Rabin Karp, Z Algorithm, Bit Manipulation, Greedy, Recursion, Backtracking, Dynamic Programming, DFS, BFS, Bellman Ford, Djikstra, Prims Algorithm, Kruskal Algorithm, Topoogical Sorting, Floyd Warshall Algorithm, Hamiltonian Cycle.
  3. Advanced Data Structures (for companies like Media.net, Uber, Codenation) :- Segment Tree, Fenwick Tree, Self Balancing Trees.

Tips :-

  1. Always read the question twice to understand each and every requirement of the question.
  2. Always see the editorial and best submission for the question you solved. This way you will always learn something new.
  3. If you are not able to solve a particular question leave it for sometime and then come back on it later on and see if you can now. if you still dont understand then read the editorial and solve more questions related to that topic.
  4. Dont get demotivated by not performing good in contests initially, It took me 50+ contests to become expert on Codeforces.
  5. It is important to make notes.
  6. Being consistent is more important.

Resources To Learn From :-

  1. GFG
  2. Cp Algorithms
  3. Hackerearth
  4. Youtube Channels ( Luv, Striver, Aditya Verma, mycodeschool, etc )

--

--

Anupam

Application Developer 2@Oracle | Ex-Intern @ Arista Networks, Oracle | 6* @Codechef | Expert@Codeforces | IIIT A’23