> Data Structures and Algorithms (DSA) Interview Questions

Data Structures and Algorithms (DSA) Interview Questions

Data Structures and Algorithms (DSA) Interview Questions to learn data structures and algorithms for job interview questions and improve your problem solving skills to provide efficient solution to complex problems.

The best way to learn data structures and algorithms will be learn the concepts, implement it, solve the problems using concepts and then write the program in programming language you love most.

CourseGalaxy Problem Set 107

First learn the data Structures and Algorithms and implement it. Then move to problems. There are 107 problems in this CourseGalaxy Problem Set 107.

Arrays

  • Reverse the elements of an array.
  • Rotate left an array by k elements.
  • Pascal's triangle.
  • Remove duplicate elements from an unsorted array.
  • Leaders in an array
  • Sliding window maximum
  • Rotate a matrix 90 degree
  • Majority elements
  • Product of array except self
  • Inversions in an array
  • Print a square matrix spirally.
  • Merge two sorted arrays without extra space
  • Left side sum of array elements equal to right side sum

Strings

  • Reverse the letters in the words of a string.
  • Find the first non-repeating character in a string.
  • Longest substring without repeating characters
  • Print all permutations of a given string
  • Change the string to be in alphabetical order
  • Integer to roman
  • Longest palindrome in a string
  • Rotate left string1 k times to match with staring2

Linked List

  • Reverse a linked list.
  • Find out the middle node of a single linked list.
  • Find the nth node from the end of a single linked list.
  • Rotate the list left by k nodes
  • Insert a node just before and just after a node pointed to by a pointer p, without using the pointer start.
  • Exchange the pair in a single linked list
  • Find the merge point of two single linked list (Y type).
  • Insert, detect, remove a cycle in linked list.
  • Intersection of two single linked lists (elements common to both the lists).
  • Union of two single linked lists (element included only once).
  • Reorder list
  • Copy list with random pointers

Stacks and Queues

  • Reverse a string
  • Implement 2 stack in an array
  • Min Stack
  • Implement 2 queue in an array
  • Evaluation of postfix
  • Valid parentheses
  • Largest rectangle In histogram
  • Next greater element

Recursion

  • Program to find the factorial of a number using recursion.
  • Summation of numbers from 1 to n
  • Displaying numbers from 1 to n
  • Display and find out the sum of series 1 + 2 + 3 + 4 + 5 +.......
  • Display digits of an integer number and finds the sum of digits of that number
  • Convert a positive decimal number to Binary, Octal or //Hexadecimal
  • Find the exponentiation of a number (a power n, example 2 power 3 = 8)
  • Display the prime factors of a number

Trees

  • Level order traversal of a binary tree
  • Height of a binary tree
  • K-th smallest element in a binary search tree
  • Check if a binary tree is BST or not
  • Find minimum and maximum in binary search tree.
  • Construct binary tree from postorder and inorder traversal
  • Check if two trees are identical or not
  • Find the inorder predecessor/successor of a given Key in BST

Graphs

  • Number of connected components in a directed graph
  • Clone a graph
  • Detect cycle in a directed graph
  • Strongly connected components
  • Is the graph Bipartite?
  • Find if a graph is strongly connected or not
  • Number of islands
  • Course schedule

Sorting, Searching, Hashing

  • Search in a rotated sorted array
  • Design hashmap
  • Search a 2D matrix
  • Partition an array such that all the even numbers are on the left side of array and odd numbers on the right side.
  • Find the k-th smallest element in an array.
  • Count negative numbers in a sorted matrix
  • Maximum consecutive ones
  • Divide two integers

Heap

  • K-th largest element
  • Top k most frequent elements
  • Merge k sorted arrays
  • Merge k sorted linked lists
  • Find median from data stream

Trie

  • Implement trie - insertion, search, deletion, startsWith, display
  • Removal of longest key in a trie
  • Number of keys with common prefix in trie
  • Keys starts with and ends with in trie
  • Finding longest key in trie

Bit Manipulation

  • Reverse integer
  • Find if a number is power of two
  • Power set
  • Single number
  • Missing number
  • Number of bits to be flipped to convert A to B
  • Reverse bits
  • Sum of two integers

Backtracking

  • Palindrome partitioning
  • Subsets
  • Print all permutations of a string
  • N Queens
  • Sudoko solver
  • Word search
  • Rat in a maze
  • Combination sum

Dynamic programming

  • Coin change
  • 0-1 Knapsack
  • Fibonacci number
  • Longest increasing subsequence
  • Egg dropping
  • Edit distance
  • Climbing stairs
  • Matrix chain multiplication

Data Structures and Algorithms (DSA) Online Courses

Data Structures and Algorithms in C/C++/C#/Java/Python (DSA) online courses.

Your Instructor


Deepali Srivastava has a Master's degree in Mathematics and is the author of "Ultimate Python Programming" and popular books "C in Depth" and "Data Structures Through C in Depth" helped 350,000+ students. She loves programming, DSA and is passionate about teaching. More than 20,000+ students have enrolled in her Data Structures and Algorithms (DSA) online courses. Whether writing a book or making a course, she always tries to present the concepts in a simplified way which helps students develop interest in the topic being taught.