Two semesters of pure Data Structures and Algorithms
By: Uddeshya Singh
Tags: Data Structures, Coding, Computer Science, Algorithms, Competitive Programming

A journey of grind in Codeforces, Codechef and a fair combination of LeetCode and Geeks for Geeks.

Data Structures and Algorithms happen to be an integral part of any Computer Science and Engineering student along with other subjects, like Operating Systems, DBMS and Networking (being my top favorites among a list of possibly 3–4 more). While such subjects exist, there is a visible highlight on the importance of Data Structures and Algorithms (which I’ll be referring to as DSA from here onward).

Why are Data Structures & Algorithms so important?

The DSA happens to be seriously important for understanding the trade-offs which will occur in memory and time efficiency for any given logical problem if you chose to solve it using a computer program.

For example : Using hash maps to store the key for key value pairs definitely reduces the time involved but requires a greater amount of memory, while on the other hand, storing key-value pairs in a vector will decrease the space involved in the problem solving considerably, but will increase the value fetch time from O(1) to O(log n) considering that you are using binary search to fetch the key. Hence, a space-time trade off is existing always.

This was just one example, but algorithms like Dynamic Programming (which is nothing but essentially a smarter version of Bruteforce) implement such insights almost all the time and these insights are seriously important in your core product development strategies.

Of course, another angle lies in the fact that being a computer science student, this section is tested thoroughly in job interviews and being good at it requires thorough practice and naturally, we happen to prioritize this in our minds.

Myth Buster: Development and Data Structures have nothing to do with each other?

Being a full-stack and machine learning developer myself, I used to resent DSA a lot in the early years of engineering, and might still do due to the time-intensive nature of this field, but tossing it away under the presumption that these two fields don’t intersect at all, would be an irresponsible thing to do.

You cannot understand the DOM and React States without understanding the fundamental of Trees. You seriously can’t imagine implementing JSON structures without getting a hold of how to unpack them and how similar that unpacking is to Classical Stack bracketing problems and above all if you are a Linux programmer and are planning to do kernel level programming without understanding Queues and B-Trees, let me burst the bubble for you, it’s going to be a hell ride.

So, the point is, to truly understand the kind of development you are pursuing, you need to understand the underlying foundations and in those foundations, you are bound to meet these data structures disguised as XML, DOM, CNN Masking Layers and what not!

My Journey

After my Google Summer of Code internship ended in the summer, it was my time to take up a new challenge and essentially prepare myself for job interviews of the 7th semester (while I was in the 5th of my college). One knows that subjects like OS, DBMS and Networking will be taught in the college with proper vigor but DSA is a different story and requires an extra layer of dedication.

LeetCode

I started off late August and chose C++ as my go-to language (I love Python, I really do, but C++ has its own charm). I started off solving Linked List and Stacks questions on LeetCode

submission history in LeetCode (not so proud of it but okay)

The intensive LeetCode sessions were consistent for a few months (the break period you might be noticing was me volunteering in the college fest). During this stint, I majorly touched topics of Stacks, Queues, Trees, Linked Lists and some parts of Depth First Search and Dynamic Programming and the problem difficulties majorly oscillating between medium and easy.

Codeforces

I then moved on Codeforces, upon recommendation from seniors and watching my peers growing in their quick problem-solving skills. One note, Codeforces is intense. Speed matters for your rank to improve and wrong submissions are punished heavily. I joined in as uddeshya.singh (I had an account previously set up but wasn’t active back then)