Two semesters of pure Data Structures and Algorithms

Uddeshya Singh
Project Heuristics
Published in
6 min readMar 12, 2020

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)

codeforces graph for uddeshya.singh
The Codeforces Hustle

My return to Codeforces is marked as the blue circle. The beginning was horrible. I was slow, gave multiple wrong answers, and even reached newbie. But the key is not to give up. In the following months, I improved my speed (and am still working on it) and solved (almost) all the questions from 1200–1400 ratings in the following problem set tags: Greedy, Dynamic Programming, Binary Search, Maths, Trees, Double Pointers, Sorting and Constructive Implementations and slowly saw my through being a 1500+ rating specialist.

Trust me, their Div. 2 and Div. 3 contests are a charm for improving your quick speed implementations and on-the-feet logical problem-solving skills and constant practice will only improve you further!

Codechef

My relationship with Codechef is pretty toxic, not going to lie. While they have 2 short contests and one official long contest every month to give you a chance to improve your ratings, their contest structure could definitely use a remodel. Nevertheless, I just participate in monthly long contests, with no additional problem solving on this site at least. The yellow marker marks the return into the competitive programming section.

Codechef improvement graph over time

Ending Thoughts

Towards the end, I would like to consolidate everything which I learned in my journey so far.

Data Structures skills != Codeforces Ratings

Improving your ratings is fun, but trust me when I say this, your data structure skills have nothing to do with your competitive programming skills. The rating is just gamification of problem-solving scores to keep users engaged and not necessarily act as a definite marker for your own skills per se.

Speed improvement? Competitive Programming is the way to go

For improvement in speed of your logical problem skills and identification of the problem and quickly typing it all out, I would definitely say that you should give it a try, Codeforces and Codechef are your friends here.

Need Data Structures just for Interviews?

If you are doing DSA purely on interview and job procurement objective, go for GeeksForGeeks, InterviewBit, and LeetCode.

GeeksForGeek’s practice dashboard.

They are excellent in terms of interview specific questions provided and gives you a deeper insight into what kinds of questions are asked by which company in recent years which I am sure, will always come in handy.

Practice Practice Practice

Last but the most important, constant practice is the only key to improve yourself, nothing else will ever come close to be handy in your problem-solving skill improvement. It’s just pure and consistent practice.

With this, I hope you continue with your grind and somehow juggle both development and these fun pursuits in your time as a hobby if you decide to pursue a computer science degree anywhere in the world!

--

--

Uddeshya Singh
Project Heuristics

Software Engineer @Gojek | GSoC’19 @fossasia | Loves distributed systems, football, anime and good coffee. Writes sometimes, reads all the time.