Open In App

Top 100 Data Structure and Algorithms DSA Interview Questions Topic-wise

Last Updated : 15 Jun, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

DSA has been one of the most popular go-to topics for any interview, be it college placements, software developer roles, or any other technical roles for freshers and experienced to land a decent job. If you are among them, you already know that it is not easy to find the best DSA interview questions among the vast pool of available problems. So here we are, with the Top 100 most asked DSA interview questions to help you sail through your technical rounds.

Top 100 Data Structure and Algorithms (DSA) Interview Questions Topic-wise

Top 100 Data Structure and Algorithms (DSA) Interview Questions Topic-wise

In this Top 100 DSA interview questions, we have segregated the problems based on the Data structure or algorithm used to solve them. Without further delay, let us begin your interview preparations:

DSA Interview Questions on Array

  1. Check if pair with the given Sum exists in Array
  2. Best Time to Buy and Sell Stock
  3. Find duplicates
  4. Product of Array Except Self
  5. Maximum Subarray
  6. Maximum Product Subarray
  7. Find Minimum in Rotated Sorted Array
  8. Search in Rotated Sorted Array
  9. 3 Sum
  10. Container With Most Water
  11. Find the Factorial of a large number
  12. Trapping Rain Water
  13. Chocolate Distribution Problem
  14. Insert Interval
  15. Merge Intervals
  16. Non-overlapping Intervals

DSA Interview Questions on Matrix

  1. Set Matrix Zeroes
  2. Spiral Matrix
  3. Program to find the transpose of a matrix
  4. Word Search

DSA Interview Questions on String

  1. Longest Substring Without Repeating Characters
  2. Longest Repeating Character Replacement
  3. Smallest window in a String containing all characters of other String
  4. Check whether two Strings are anagram of each other
  5. print all anagrams together
  6. Check if given Parentheses expression is balanced or not
  7. Sentence Palindrome
  8. Longest Palindromic Substring
  9. Palindromic Substrings
  10. Longest Common Prefix

DSA Interview Questions on Linked List

  1. Reverse a Linked List
  2. Detect Cycle in a Linked List
  3. Merge Two Sorted Lists
  4. Merge K Sorted Lists
  5. Remove Nth Node From End Of List
  6. Reorder List
  7. Add 1 to a number represented as linked list
  8. Find the middle of a given linked list
  9. Delete last occurrence of an item from linked list

DSA Interview Questions on Stack & Queue

  1. Convert Infix expression to Postfix expression
  2. Next Greater Element
  3. Delete middle element of a stack
  4. Check mirror in n-ary tree
  5. The Celebrity Problem
  6. Length of the longest valid substring
  7. Print Right View of a Binary Tree
  8. Find the first circular tour that visits all petrol pumps

DSA Interview Questions on Tree

  1. Maximum Depth of Binary Tree
  2. Check if two trees have same structure
  3. Invert/Flip Binary Tree
  4. Binary Tree Maximum Path Sum
  5. Binary Tree Level Order Traversal
  6. Serialize and Deserialize Binary Tree
  7. Subtree of Another Tree
  8. Construct Binary Tree from Preorder and Inorder Traversal
  9. Validate Binary Search Tree
  10. Kth Smallest Element in a BST
  11. Lowest Common Ancestor of BST
  12. Implement Trie (Prefix Tree)
  13. Add and Search Word

DSA Interview Questions on Heap

  1. Top K Frequent Elements
  2. Find Median from Data Stream
  3. Largest triplet product in a stream
  4. Connect n ropes with minimum cost

DSA Interview Questions on Graph

  1. Clone Graph
  2. Course Schedule
  3. Pacific Atlantic Water Flow
  4. Number of Islands
  5. Longest Consecutive Sequence
  6. Snake and Ladder Problem
  7. Detect Cycle in a Directed Graph
  8. Bridges in a graph
  9. Check whether a given graph is Bipartite or not
  10. Find size of the largest region in Boolean Matrix
  11. Flood fill Algorithm
  12. Strongly Connected Components
  13. Topological Sorting

DSA Interview Questions on Dynamic Programming

  1. Count ways to reach the n’th stair
  2. Coin Change
  3. 0/1 Knapsack Problem
  4. Longest Increasing Subsequence
  5. Longest Common Subsequence
  6. Word Break Problem
  7. Dice Throw 
  8. Egg Dropping Puzzle
  9. Matrix Chain Multiplication
  10. Combination Sum
  11. Subset Sum Problem
  12. Find maximum possible stolen value from houses
  13. Count Possible Decodings of a given Digit Sequence
  14. Unique paths in a Grid with Obstacles
  15. Jump Game
  16. Cutting a Rod
  17. Maximum Product Cutting
  18. Count number of ways to cover a distance

DSA Interview Questions on Bit Manipulations

  1. Number of 1 Bits
  2. Counting Bits
  3. Missing Number
  4. Reverse Bits
  5. Find XOR of all subsets of a set

Related posts:

Some other important Tutorials:



Previous Article
Next Article

Similar Reads

Maths for Data Structure and Algorithms (DSA) | A Complete Guide
Maths is a fundamental component of learning Data Structure and Algorithms, just like in programming. Maths is primarily used to evaluate the effectiveness of different algorithms. However, there are situations when the answer requires some mathematical understanding or the problem has mathematical characteristics and certain problems demand more t
15+ min read
What is DSA | DSA Full Form
What is DSA?DSA(Data Structures and Algorithms) is defined as a combination of two separate yet interrelated topics – Data Structure and Algorithms. DSA is one of the most important skills that every computer science student must have. It is often seen that people with good knowledge of these technologies are better programmers than others and thus
2 min read
Search in a Row-wise and Column-wise Sorted 2D Array using Divide and Conquer algorithm
Given an n x n matrix, where every row and column is sorted in increasing order. Given a key, how to decide whether this key is in the matrix. A linear time complexity is discussed in the previous post. This problem can also be a very good example for divide and conquer algorithms. Following is divide and conquer algorithm.1) Find the middle elemen
15+ min read
Sort the matrix row-wise and column-wise
Given a n x n matrix. The problem is to sort the matrix row-wise and column wise. Examples: Input : mat[][] = { {4, 1, 3}, {9, 6, 8}, {5, 2, 7} } Output : 1 3 4 2 5 7 6 8 9 Input : mat[][] = { {12, 7, 1, 8}, {20, 9, 11, 2}, {15, 4, 5, 13}, {3, 18, 10, 6} } Output : 1 5 8 12 2 6 10 15 3 7 11 18 4 9 13 20 Approach: Following are the steps: Sort each
9 min read
Largest row-wise and column-wise sorted sub-matrix
Given an N * M matrix mat[][], the task is to find the area-wise largest rectangular sub-matrix such that each column and each row of the sub-matrix is strictly increasing. Examples: Input: mat[][] = {{1, 2, 3}, {4, 5, 6}, {1, 2, 3}} Output: 6 Largest sub-matrix will be {{1, 2, 3}, {4, 5, 6}}. Number of elements in this sub-matrix = 6. Input: mat[]
13 min read
Maximum sum of any submatrix of a Matrix which is sorted row-wise and column-wise
Given a matrix mat[][] whose elements are sorted both row-wise and column-wise. The task is to find the maximum sum of any submatrix from the given matrix mat[][]. Examples: Input: mat[][] = { {-6, -4, -1}, {-3, 2, 4}, {2, 5, 8}} Output: 19 Explanation: The largest submatrix is given by: 2 4 5 8Input: mat[][] = { {-4, -3}, {-2, -1} } Output: -1 Exp
10 min read
C++ Program to Sort the matrix row-wise and column-wise
Given a n x n matrix. The problem is to sort the matrix row-wise and column wise.Examples:   Input : mat[][] = { {4, 1, 3}, {9, 6, 8}, {5, 2, 7} } Output : 1 3 4 2 5 7 6 8 9 Input : mat[][] = { {12, 7, 1, 8}, {20, 9, 11, 2}, {15, 4, 5, 13}, {3, 18, 10, 6} } Output : 1 5 8 12 2 6 10 15 3 7 11 18 4 9 13 20   Approach: Following are the steps:  Sort e
3 min read
Java Program to Sort the matrix row-wise and column-wise
Given a n x n matrix. The problem is to sort the matrix row-wise and column wise.Examples:   Input : mat[][] = { {4, 1, 3}, {9, 6, 8}, {5, 2, 7} } Output : 1 3 4 2 5 7 6 8 9 Input : mat[][] = { {12, 7, 1, 8}, {20, 9, 11, 2}, {15, 4, 5, 13}, {3, 18, 10, 6} } Output : 1 5 8 12 2 6 10 15 3 7 11 18 4 9 13 20   Approach: Following are the steps:  Sort e
3 min read
Python Program to Sort the matrix row-wise and column-wise
Given a n x n matrix. The problem is to sort the matrix row-wise and column wise.Examples: Input : mat[][] = { {4, 1, 3}, {9, 6, 8}, {5, 2, 7} } Output : 1 3 4 2 5 7 6 8 9 Input : mat[][] = { {12, 7, 1, 8}, {20, 9, 11, 2}, {15, 4, 5, 13}, {3, 18, 10, 6} } Output : 1 5 8 12 2 6 10 15 3 7 11 18 4 9 13 20 Approach: Following are the steps: Sort each r
4 min read
Php Program to Sort the matrix row-wise and column-wise
Given a n x n matrix. The problem is to sort the matrix row-wise and column wise.Examples:   Input : mat[][] = { {4, 1, 3}, {9, 6, 8}, {5, 2, 7} } Output : 1 3 4 2 5 7 6 8 9 Input : mat[][] = { {12, 7, 1, 8}, {20, 9, 11, 2}, {15, 4, 5, 13}, {3, 18, 10, 6} } Output : 1 5 8 12 2 6 10 15 3 7 11 18 4 9 13 20   Approach: Following are the steps:  Sort e
3 min read
three90RightbarBannerImg