Why Data structures and Algorithms are important

Sai Prabhanj Turaga
4 min readApr 20, 2024

--

As a software or a computer science, our responsibility is to perform operations on the data. We basically perform the following steps.

First, we take the data as an input, then we process it and then we give back processed data as output. So the input of data can be in any form.

For example, when you search for a direction on a Google map, you provide the starting and ending point as an input to the Google map. It processes this data by using some processing operations and then find the shortest path between these locations and it provides as an output to us over here.

To make this process efficient we need to optimize all these three steps over here. It’s very obvious that the most we can optimize is the second step where we have data structures and algorithms. So by using graph data structures or Dijkstra’s short path algorithm, Google Maps is able to find the shortest path between the provided points very efficiently. Now in this case, Google Maps algorithm can be more complex. I just mentioned that it seems that it’s Dijkstra’s algorithm, but this is not official information.

So let’s look at another example. By now we know that data structures refer the way we organize our computer, so this has a great impact on the performance.

So in this example, suppose that you want to have a book on algorithms from the library. To get it first you go to the computer science section, then you go to algorithm section. As you can see, it’s very easy to find the book that we need.

On the other hand, if these books are not organized in this manner and just distributed randomly like shown in this picture, it will always impossible to find the book that we need.

This is the way a librarian organize it in a particular form efficiently to perform task on it. Here, books are the data and arranging them like this is a data structure and finding book that we need is an algorithm.

Thus, we can easily see how the important data structures and algorithms are. In this manner computer scientists process and look for the best way to organize the data. So it can be processed based on input provided. Okay, now we have answered the question of why data structures and algorithms are so important, so hopefully you understand the concept.

Now let’s continue to answer the second question.

Why do most companies ask questions during the interview related to data structures and algorithms?

It’s very clear that solutions to many problems that are related to software development can be found on the internet. By copying and pasting the someone else’s code without understand the logic behind it it’s not possible to become a professional software developer. By asking questions related to data structures and algorithms, interviewer checks the problem solving ability of the candidate. For instance, even though today’s computers come with more memory, if developer does not handle memory management technique, the program may leak and lose the memory. This means without understanding data structures, the code may end up with a memory leak.

The second reason for this is that interviewer has limited time to evaluate a candidate. By asking such questions an interviewer can evaluate fundamental concepts of programming. This means that if a candidate is good at data structures and algorithm, they can learn a new technology or programming language easily. They just needs to learn the syntax of the programming language.

Hopefully you have understood why data structures and algorithms are important in programming.

--

--