DS and Algo Interview Questions
In the ever-evolving tech industry, data structure and algorithm knowledge plays a crucial role in landing top-notch job offers. As we approach 2023, it’s essential to stay updated and well-prepared for data structure and algorithm interviews. In this blog post, we’ll provide you with a comprehensive guide that covers the key concepts, problem-solving techniques, and tips to excel in your upcoming interviews.
Table of Contents:
1 Integer
- FizzBuzz (LC 412)
- Palindrome Number (LC 9)
- Factorial Trailing Zeroes (LC 172)
- Pow(x,n) (LC 50)
- Above Integer related questions solution
2 Strings
- Reverse String (LC 344)
- Longest Common Prefix (LC 14)
- Reverse Words in a String (LC 151)
- Longest Palindromic substring (LC 5)
- Longest substring without repeating characters (LC 3)
- Valid Parentheses (LC 20)
- Decode String (LC 394)
- Word Break (LC 139)
- Valid Anagram (LC 242)
- Repeated DNA Sequences (LC 187)
- Integer to English Words (LC 273)
- Above String related questions solution
3 Arrays
- Sort Colors (LC 75)
- Merge Sorted Array (LC 80)
- Two Sum (LC 1)
- Binary Search (LC 704)
- Length of Last Word (LC 58)
- Plus One (LC 66)
- Jump Game (LC 55)
- Move Zeroes (LC 283)
- Asteroid Collision (LC 753)
- Kids with Greatest Number of Candies (LC 1431)
- Average Salary Excluding the Minimum and Maximum (LC 1491)
- Best Time to Buy and Sell Stock (LC 122)
- Best Time to Buy and Sell Stock II(LC 122)
- Find All Disappeared Numbers in an Array (LC 448)
- Find All Duplicates Numbers in an Array (LC 442)
- Pascal’s Triangle (LC 118)
- Pascal’s Triangle (LC 119)
- Sequential Digits (LC 1291)
- Product of Array Except self (LC 238)
- Gas Station (LC 134)
- Rotate Array (LC 189)
- Minimum Domino Rotations For Equal Row (LC 1007)
- Subarray Product Less than K (LC 713)
- Jump Game III (LC 1306)
- K-Diff Pairs in an Array (LC 532)
- Majority Element Solutions (LC 169)
- House Robber II (LC 213)
- Maximum Product Subarray (LC 152)
- Group Anagrams (LC 49)
- 132 Pattern 3 solution (LC 456)
- First Missing Positive (LC 41)
- Sliding Window Maximum (LC 239)
- Median of Two Sorted Arrays (LC 4)
4 Two Pointer
- Is Subsequence (LC 392)
- Valid Palindrome (LC 125)
- Squares of a Sorted Array (LC 977)
- Remove Duplicates from Sorted Array (LC 26)
- Trapping Rain Water (LC 42)
- 3 Sum (LC 15)
5 Famous Algorithm
- Kaden’s Algorithm -Maximum Subarray (LC 53)
6 Sorting Algorithm
- Merge Sort Sort an Array (LC 912)
- Quick Sort Sort an Array (LC 912)
7 2D Arrays Matrix
- Rotate Image (LC 48)
- Remove Covered Interval (LC 1288)
- Merge Intervals (LC 56)
- Matrix Diagonal Sum (LC 1572)
- Search a 2D Matrix (LC 74)
- Set Matrix Zeroes (LC 73)
- Spiral Matrix (LC 54)
8 Linked List
- Flatten Binary Tree to Linked List (LC 114)
- Add Two Linked Lists Add Two Numbers II (LC 445)
- Odd Even Linked List (LC 238)
- Rotate List (LC 61)
- Swap Nodes In Pairs [Iterative] (LC 24)
- Swap Nodes In Pairs [Recursive] (LC 24)
- Middle of a Linked List (LC 876)
- Linked List Cycle II (LC 142)
- Linked List Cycle (LC 141)
- Reverse Linked List [Iterative+Recursive] (LC 206)
- Merge Two Sorted Lists (LC 21)
- Intersection of Two Linked List (LC 160)
- Palindrome Linked List (LC 234)
- Copy List with Random Pointer (LC 138)
- Reverse Nodes in k-group (LC 25)
- LRU Cache (LC 146)
- Design Linked List (LC 707)
9 Tree, Stack, Queue
- Binary Tree Preorder Traversal Recursive + Iterative Solution (LC 144)
- Binary Tree Inorder Traversal Recursive + Iterative Solution (LC 94)
- Binary Tree Post Order Traversal Recursive + Iterative (LC 145)
- Level Order Traversal Binary Tree Recursive + Iterative (LC 102)
- Binary Tree Zigzag Level Order Traversal Recursive + Iterative (LC 103)
- Convert Sorted Array to Binary Search Tree (LC 108)
- Construct Binary Search Tree from Preorder Traversal (LC 1008)
- Diameter of Binary Tree (LC 543)
- Range Sum of BST (LC 938)
- Same Tree (LC 100)
- Flipinvert Binary Tree (LC 226)
- Minimum Depth of Binary Tree (LC 111)
- Maximum Depth of Binary Tree (LC 104)
- Balanced Binary Tree (LC 110)
- Insert into a Binary Search Tree (LC 701)
- Serialize and deserialize binary tree (LC 297)
- Binary Tree Maximum Path Sum (LC 124)
- Implement Trie (LC 208)
- Validate Binary Search Tree (LC 98)
- Robber House III (LC 337)
- Lowest Common Ancestor of Binary Tree (LC 236)
10 Graph
- Number of Islands (LC 200)
- Clone a Graph (LC 133)
11 Fibonacci Sequence
- Climbing Stairs
12 Backtracking Recursion
- Generate Parentheses (LC 22)
- Combination Sum (LC 39)
- Combination Sum III (LC 216)
- Subsets (LC 78)
13 Dynamic Programming
- Climbing Stairs (LC 70)
- Fibonacci Number 3 (LC 509)
- Minimum Path Sum (LC 64)
- House Robber (LC 198)
- Longset Increasing Subsequence (LC 300)
- Best Time to Buy and Sell Stock IV (LC 188)
- Longest Common Subsequence (LC 1143)
- Edit Distance (LC 72)
- Wilcard Matching (LC 44)
- Regular Expression Matching (LC 10)
14 Bit Manipulation
- Number of 1 Bits (LC 191)
- Find the Difference (LC 389)
- Reverse Bits (LC 190)
- Hamming Distance (LC 461)
- Complement of Base 10 Integer (LC 1009)
- Counting Bits (LC 338)
- Sum of Two Integers (LC 371)
- Divide Two Integers (LC 29)
15 Design
- Design a Stack MinStack (LC 155)
16 System Design
17 System Scaling