DEV Community

Cover image for DSA for Frontend devs
Sadanand Pai
Sadanand Pai

Posted on

DSA for Frontend devs

Hello folks,

Today, we'll discuss a contentious issue that is frequently raised. Do frontend developers require DSA? I'll discuss the value of DSA and the interview environment that surrounds it with you. We'll try to ultimately uncover the unknowns and let us get clarity on the same.

What is DSA

Data Structures and Algorithms is what DSA stands for. It is one of the key areas of computer science and involves math, justifications, problem-solving strategies, optimizations, etc.

Data structure: The way data is stored or represented

Algorithms: A step-by-step process to solve a problem

Each day, we write tens of thousands of lines of code as software developers. The majority of the code is often written in JavaScript by frontend developers. Our projects present us with several everyday coding problems that we must resolve to finish our work. One of the key competencies that any front-end developer should possess is the ability to solve problems and consistently finish their logic.

Before proceeding further with the discussion of DSA, let's look at the importance of DSA in general.

How does DSA help a programmer?

I would like to start by giving an analogy. Assume there is an artist. His or her job is to draw or paint. To become an artist, one needs mainly two things.

  • The first is the tools. He/she needs to have brushes, pencils, colors, paper, etc.

  • The other thing which makes a painter needs to have is a way to use these tools, a process, or a procedure.

The artist will need a variety of colored pencils, brushes, and shading techniques to draw complicated art, such as a person's face. A beautiful drawing will be produced if the artist properly employs the correct tools. Furthermore, if the artist lacks some of the required equipment or is unable to use some of it, the quality of the artwork may suffer. Additionally, a lot of time and work may be required to create the same painting. In other cases, an artist may not even be able to sketch if they lack the necessary supplies or drawing techniques.

Why did we talk about art? Here, the art tools stand in for the data structures. Additionally, the act of drawing is a representation of algorithms.

Programming is no less than an art

Developers must use the appropriate set of data structures and algorithms when writing code, much like when creating a beautiful painting. If a developer writes code without the proper DS or algorithm, writing and running the code may require a lot of work and time. And in many situations, having a lack of knowledge may also prevent you from coming up with a solution.

Importance of DSA

With the help of a simple coding example, I will highlight the importance of DSA in our daily programming.

Problem statement: You are asked to find the students who have scored highest and lowest in a class.

First Solution: The simple procedure you follow might be to sort the list of students according to their marks. And then pick the names from the start and end of the list. It is simple.

Sorting the list

If a class has 30 students, sorting the students by marks is an easy task. What if you are asked to find the students with the highest and lowest marks from the whole college? The total number of students may reach 300 or 3000. It is not easy for humans to perform sorting, but for computers, it may look almost the same. No big deal. But what if you are asked to find students from a country? The solution proposed may take years for humans and a huge amount of time for computers. Something that makes you think now.

Second solution: We just need to find the highest and lowest-scored students. Check the marks of each student and keep a note of who has scored highest and lowest. No sorting is needed for this.

The second solution is much better than the first one for the given question. But how was I able to tell that the second solution was better? This is one of the places where knowledge of data structures and algorithms comes into play.

Where the hell is DSA?

You may argue that the above-given task is not a DSA problem. Where is the data structure like a Tree or Graph and where the hell is the algorithm in there?

Read the definitions of data structures & algorithms. Here, the list of students stored in an array or list is a data structure. The procedure to get the highest and lowest marks for students is the algorithm. We stored the student data in the right data structure and then ran the algorithm to find the required students.

We discussed a lot about DSA without using a code snippet of any programming language. DSA is about concepts and is not particularly related to any programming language.

Before moving on, let us be on the same page. DSA is not only about fancy and advanced concepts of problem-solving such as graphs and dynamic programming. DSA starts with the basics of programming and optimization. DSA is not only about problems that we solve on Leetcode.

DSA for interviews

DSA was not heavily involved in interviews in the past. Different digital products were being built by businesses using the waterfall process. As electronic gadgets became more widely available, there was an exponential rise in demand for better softwares. More softwares were being created by businesses, and these products were receiving numerous updates. Businesses began implementing agile methodologies. Robust, scalable, and highly efficient code is increasingly needed to meet the expanding demand and adapt to the changing requirements. So there is a need for competent developers.

Companies, particularly those that manufacture products, started looking for talented programmers to design excellent code so that the items they create can be updated or improved more affordably. Additionally, the program should be lightning-fast to draw in more clients to their merchandise. The necessity to overcome challenging programming problems grew. It has also become necessary to provide effective frameworks and libraries. The performance (duration of execution) of the code becomes crucial.

Companies began structuring the interviews so that they could find qualified programmers. DSA became so common in interviews that most businesses now have at least one round specifically for it. The DSA round required difficult problems to be solved by the candidates to pass the interviews because the real-world challenges that had to be solved were challenging in a number of scenarios.

The DSA round was eventually added to the interviews by all companies, and the tendency persisted. The majority of businesses never even consider whether they need a specific DSA round for the position they are hiring for. Additionally, they frequently use medium- or difficult-level problems pulled at random from Leetcode.

Companies must be aware of the DSA requirements for the positions for which they are hiring and adjust the DSA interview process accordingly. But on the other hand as a candidate, you don't have control over it. It is a game. They are rule setters. Play the game as per their game rules if you want to win it.

Is DSA needed for Frontend developers?

There is a huge debate everywhere nowadays around a few questions related to DSA in the frontend world,

  • Should frontend developers learn DSA?

  • Should there be a DSA round for frontend developers?

  • How much DSA is needed for frontend developers?

"DSA is not required for frontend developers", according to a lot of individuals on YouTube and other channels. They mean to argue that frontend developers won't require advanced DSA. There is no clear line between what is basic and what is advanced, and we won't get into that issue here. The phrase "whether DSA is needed or not" is not a boolean thing. There isn't a yes/no answer to this.

We have advanced much if we consider the development of the frontend ecosystem. There was a time when JavaScript was primarily used for simple UI tasks, but today we utilize JavaScript to construct complete end-to-end systems. Frontend web development now includes everything from interactive online editors to graphically intensive games. Frameworks and libraries for the front end have never been so plentiful. Various frontend areas desperately need DSA.

This does not imply that frontend devs in every project or firm are required to have extensive DSA knowledge. A few frontend positions only need a working grasp of JavaScript. We must assess our objectives and job descriptions to modify the need for DSA for roles. We need to stop fearing or disliking the word DSA, and instead embrace the knowledge it offers to aim to become highly competent programmers and good developers.


All of us are engineers. Building high-quality products that are scalable, reliable, and efficient should be our main priority. If DSA can assist us in this, we ought to choose it rather than reject it. Problem-solving in the real world is what we prioritize.

A good engineer is a good problem solver too.

I hope I was able to shed some light on the confusion around DSA and help you to get some clarity. Also, I expect that you are now in a better place to judge whether as a frontend developer, should you focus on DSA for your work or interviews.

Top comments (0)