Why Do Companies Ask DSA Questions in Interviews?

Why Do Companies Ask DSA Questions in Interviews?

What is DSA?

DSA stands for Data Structures and Algorithms. It is also sometimes referred to as PSDS - Problem Solving Data Structures. DSA is applied in problem-solving and enables developers to learn to write efficient code. The quality of the code can be judged by how much memory and time it consumes. The lesser memory the code consumes and the faster it runs, the more efficient it is.

Why is DSA important?

A person equipped with strong DSA skills will have better and more efficient approaches to solving a problem than someone who is not aware of DSA concepts.

You might not apply DSA directly in your job, but DSA is the foundation of computer science. You will certainly be a better software engineer if you have mastered DSA. So it's advisable to slowly master it at the beginning of your IT career itself.

How do companies use DSA?

Companies use DSA in mainly two ways -

In both of these cases, you as a candidate are required to write code to solve a problem that uses DSA.

Websites like HackerRank, LeetCode, and CodeForces have large sets of problems ranging from easy, medium, and hard levels of difficulty. Anybody can sign up on these websites and solve problems by writing code in any of the major programming languages and hone their skills in PSDS.

A lot of companies also use these websites to set interview questions. These websites have powerful evaluation tools to check your program for different test cases and also to test your program for plagiarism.

1. Online Screening

Companies use DSA to filter candidates. A company could have as many as 500 applicants and they might need to shortlist 20 candidates. DSA coding assessments serve as an objective way to filter the candidates.

By doing this,

  1. The company spends < 1-2 hors setting problems on HackerRank and get automated leaderboard performance results back from Hackerrank.
  2. Candidates don’t spend more than 2 hours of their time going to the next stage of the interview.

Without doing this,

  1. The company asks all the 500 applicants to build a project for 12 hours
  2. The company has to build automatic assessments for this project which is 20+ hours of work for their engineers
  3. Candidates who get rejected have wasted 12 hours of their precious time.

How are coding assessments fair?

  1. The coding ability of the candidates is judged.
  2. Depth of DSA knowledge is judged based on the difficulty level of the problems set.

But there are some disadvantages to this method of filtering candidates

1. Plagiarism

Anybody can take up the online test unless strict measures of proctoring are implemented.

2. Problem Difficulty

The difficulty of the problems is progressively raised with a larger number of candidates. This is because companies don’t want all candidates to have the same score; they need a stack rank.

Because of this, online coding assessments can become too hard, more than what is required for the job.

2. Personal interviews

Apart from coding ability & DSA knowledge, the personal interview rounds aim at assessing a few more skills of the candidate:

Problem-solving ability

They evaluate if you are able to ask the right questions, come up with multiple solutions, are able to cover all aspects of the problem, make the right trade-offs, etc.

Debugging ability

The interviewer will also assess you by checking if you are able to structurally debug the code when you face issues.

In other terms, during online assessments, companies usually look for the final output of the code you have written. Whereas during personal interviews, the interviewer is interested in understanding your approach to solving the problem.

Well-prepared interviewers don’t usually ask standard leetcode problems in this round. They will ask you more realistic problems to see how you approach them.

Even if very difficult problems are asked here, interviewers are more interested in knowing what approach you have taken to solve the problem than the final output alone.

How effective are these interviews?

DSA interviews do a very fair estimation of your

Debugging skills are particularly assessed during the personal interviews.

In Reality…

PSDS has turned into a filtering criterion that everyone prepares too much for. A lot of companies end up asking some of the most standard questions, and since these are standard, if you have prepared for the exact same question, you will be able to solve it.

The idea of assessing the candidate's cognitive, problem-solving and coding abilities gets lost in the process.

Practicing some important 400+ leetcode problems sometimes becomes sufficient to crack online screening rounds.

To overcome this, companies keep bumping up the difficulty level of the problems, so that they can differentiate between candidates who have prepared in advance by solving a large number of problems and the ones who have genuinely solved the problem then and there.

For this reason, the DSA interviews have become 5 times more difficult than what is necessary for you to become a good software developer.

How much DSA do you really need to study?


Practice and expansion of your knowledge in DSA are going to be key to cracking interviews.

Ensure a good chunk of your time for this before you start applying for companies.

Here's a 3 stage DSA preparation plan to get you started.

All the best! And Good Luck!

You've successfully subscribed to Crio Blog
Great! Next, complete checkout to get full access to all premium content.
Welcome back! You've successfully signed in.
Unable to sign you in. Please try again.
Success! Your account is fully activated, you now have access to all content.
Error! Stripe checkout failed.
Success! Your billing info is updated.
Billing info update failed.