LogIn
I don't have account.

DSA Interview Coding Problems

DevSniper
177 Views

Data Structures and Algorithms (DSA) are backbone of computer science and are crucial for technical interviews in software engineering and related fields. This article provides list of common Data Structures and Algorithms (DSA) interview questions topic wise that are often asked in technical interviews.

DSA Interview Questions on Array

DSA Interview Questions on String

DSA Interview Questions on Linked List

  • Detect a cycle in a linked list
  • Reverse a linked list
  • Add Two Numbers
  • Find the middle of a given linked list
  • Delete last occurrence of an item from linked list
  • Remove Kth Node from End of Linked List
  • Merge Two Sorted Linked Lists

DSA Interview Questions on Matrix

  • Set Matrix Zeroes
  • Rotate a given matrix by 90 degrees clockwise or counterclockwise
  • Write a program to compute the transpose of a given matrix
  • Program to multiply two matrices
  • Search in a Sorted Matrix
  • Find the Row with Maximum 1s
  • Spiral Matrix
  • Program to add and subtract two matrices

DSA Interview Questions on Stack and Queue

  • Implement Stack data structure with operations like push, pop, and peek
  • Find the next greater element for every element (next greater element to the right) of an given array
  • Valid Parentheses
  • Delete middle element of a stack
  • Evaluate postfix expressions using a stack
  • Print Right View of a Binary Tree
  • Implement a queue using stacks
  • Min Stack : Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
  • Largest Rectangle in Histogram
  • Given an arithmetic expression in Reverse Polish Notation, evaluate it

DSA Interview Questions on Tree

  • Validate if a binary tree is a binary search tree (BST)
  • Find the lowest common ancestor (LCA) of two nodes in a binary tree
  • Maximum Depth of Binary Tree
  • Binary Tree Maximum Path Sum
  • Binary Tree Level Order Traversal
  • Serialize and Deserialize Binary Tree
  • Construct Binary Tree from Preorder and Inorder Traversal
  • Kth Smallest Element in a BST
  • Check if two trees have same structure
  • Binary Tree to Doubly Linked List
  • Minimum Depth of Binary Tree
  • Find the lowest common ancestor of two nodes in a Binary Tree

DSA Interview Questions on Graph

  • Detect Cycle in a Directed Graph
  • Bridges in a graph
  • Find the shortest path between two nodes in a weighted graph
  • Clone Graph
  • Longest Consecutive Sequence
  • Snake and Ladder Problem
  • Number of Islands
  • Flood fill Algorithm

DSA Interview Questions on Dynamic Programming

  • 0/1 Knapsack problem
  • Compute Fibonacci numbers using dynamic programming
  • Coin Change
  • Count ways to reach the n’th stair
  • Longest Common Subsequence
  • Longest Increasing Subsequence
  • Edit Distance : Compute the minimum number of operations required to transform one string into another, where operations can be insertion, deletion, or substitution of a single character
  • Subset Sum Problem : Given a set of non-negative integers, determine if there exists a subset whose sum is equal to a given sum
  • Word Break Problem : Given a string and a dictionary of words, determine if the string can be segmented into a space-separated sequence of dictionary words
  • Dice Throw
  • Maximal Square : Find the side length of the largest square containing only 1's in a binary matrix
  • Minimum Path Sum : Find the minimum sum of a path from the top-left to the bottom-right of a m x n Matrix, moving only right or down
  • Unique Paths : Count all possible unique paths from the top-left to the bottom-right of a m x n matrix
  • Longest Palindromic Substring : Find the longest substring in a given string that is a palindrome