Since college days, we have been hearing that Data Structures and Algorithms are one of the most fundamental concepts in software engineering. A big, high-paying software engineering company rigorously evaluates a software engineer in DSA in an interview.
When I was in college, I too had many questions in my mind about the importance of DSA. Everyone should try to find answers to the following questions;
- Why are Data Structures and Algorithms so important in the software world?
- Can good software be built without thinking about Data Structures and Algorithms?
- Why do high-paying companies ask for expertise in DSA?
- Can a software engineer survive and grow without learning DSA?
- Is it needed to learn DSA when AI can give us optimised code?
Why are Data Structures and Algorithms so important in the software world?
Data Structures and Algorithms help us to optimise two very important aspects of building software. One aspect is Space, and another is Time.
Let’s understand the Space aspect first.
A person who is building his home on the land wants to utilise space in a very smart way. He would like to build every needed thing within that area. He doesn’t want to waste even a single inch of his land on nothing. For example, he doesn’t want to make a room so big that there is very little space left to make a bathroom.
After reading the above example, I hope you have understood that we have a very limited space and within that space, we want to get our work done. In other words, we want to utilise our limited space as much as possible. Why? Because space is costly. Every additional space comes with an additional cost. This additional cost can be saved if the existing space is used smartly.
Let’s understand the importance of space in the software engineering context with a real-world example:
Below is the cost of hosting a small app that uses 2 gb of ram and 50gb of ssd in aws, gcp, and azure
AWS | ~23 $ per month |
GCP | ~24 $ per month |
AZURE | ~25 $ per month |
Space comes with a cost, and DSA helps us to use space as efficiently as possible.
Now, let’s understand the Time Aspect
If you were to search for a contact in an unsorted phonebook, you would start from the beginning to the end to find a contact. You realise that it will be a very time-consuming activity when you have to go through each page to find something.
What if a phonebook were sorted alphabetically? Then, you will immediately skip many pages and start from the middle. If the contact’s name’s first letter falls behind the middle of a phonebook, you will search only in the first half and leave the second half. See, you just saved many minutes (exponentially) by skipping searching in half of the phonebook. You will repeat the same until you find your contact.
We all want to save time and get things done quickly. When it comes to software engineering, we want our software to compute as quickly as possible. No one wants to deal with slow software. Data Structures and Algorithms help us to arrange and navigate through our data in such a fashion that it can drastically save time.
A successful software is something that does the job in the least time and uses the least space. Because more space and more time are costly and definitely not attractive.
Can good software be built without thinking about Data Structures and Algorithms?
Only software can be built without thinking about DSA, not good software. A good software is something that is fast and robust. Without caring about DSA, a software will be slow due to taking up more space in memory. It can even crash in case of utilising full memory.
Honestly, no one wants to interact with such software.
Why do high-paying companies ask for expertise in DSA?
The direct answer is, it saves them a lot of money. When a code uses more space in memory, it costs a company exponentially. A software product that takes a lot of time to process a query will end up losing its customers. However, a clean and optimized code can save a lot of money too. A code that gets executed fast and doesn’t require much space will end up saving a lot of the company’s money. Hence, every software company needs a developer who understands the importance of DSA. These companies even pay very well to those developers who are experts in DSA.
Can a software engineer survive and grow without learning DSA?
Software engineering is a very wide field. It includes aspects like designing, programming, testing, monitoring, infrastructure management, analysis, and so on. There is a lot that can be done without getting much into coding or programming. However, a Software Engineer is a profile that primarily focuses on programming. To master this field as a software engineer, it is important to have a good idea and experience in data structures and algorithms.
Is it needed to learn DSA when AI can give us optimised code?
An AI can give optimized code in terms of better space and time complexities. It can help us save development time as well. However, a software engineer should also be experienced enough to judge the AI-based solution on various criteria. He needs to verify whether this AI-based solution is passing all the tests without compromising the security of the application, or if it is not too complex to understand for other developers in the company. Similarly, there will be many checks that a software developer would need to do before accepting an AI-based solution in production. How will an engineer do these checks if he is not good enough at DSA? Artificial Intelligence is just a tool that can help engineers save time, but it can not replace their minds. Just as we don’t stop learning calculations because calculators exist, we should also continue to learn the fundamentals of data structures and algorithms (DSA) even with the presence of AI.
<#KeepBuilding/>