Now we have understood the concept of data structures and algorithms.
It's time to see why they are so important and why many companies ask questions related to them at the
interviews.
Let's answer the question of why data structures and algorithms are important.
As a software or computer scientist
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 process 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 finds the shortest path between these
locations and it provides as 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
short spread 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 organizes it in a particular form to efficiently perform task.
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 looks 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 testing
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, he or she can learn a new
technology or programming language easily.
He just needs to learn the syntax of the programming language.
Hopefully you have understood why data structures and algorithms are important in programming.
So in the next video we will concentrate on types of data structures.
So see you in the next lecture.