Interview questions. Data Structures and Algorithms (DSA). Ten categories. Entry level
In entry-level interviews, especially for software engineering roles, Data Structures and Algorithms (DSA) questions are quite common. Here's a breakdown of the types of DSA questions typically asked:
🔹 1. Arrays and Strings
Common Questions:
Find the maximum subarray sum (Kadane's Algorithm)
Two Sum / Three Sum
Rotate an array
Merge two sorted arrays
Check for anagram or palindrome
🔹 2. Linked Lists
Common Questions:
Reverse a linked list
Detect a cycle in a linked list (Floyd’s cycle detection)
Merge two sorted linked lists
Find the middle node
Remove nth node from end
🔹 3. Stacks and Queues
Common Questions:
Implement a stack using queues (and vice versa)
Next Greater Element
Valid Parentheses
Min Stack
Sliding Window Maximum
🔹 4. Trees and Graphs
Common Questions:
Inorder, Preorder, Postorder traversal
Level-order traversal (BFS)
Check if a binary tree is balanced or symmetric
Lowest Common Ancestor
DFS/BFS in graphs, Cycle detection
🔹 5. Recursion and Backtracking
Common Questions:
Generate all subsets/combinations/permutations
N-Queens
Sudoku solver
Word search in a grid
🔹 6. Searching and Sorting
Common Questions:
Binary search and its variations (e.g., lower bound, upper bound)
Merge sort, Quick sort basics
Search in a rotated sorted array
Kth largest/smallest element
🔹 7. Hashing / Hash Tables
Common Questions:
Two Sum / Subarray Sum Equals K
Group Anagrams
Longest Consecutive Sequence
LRU Cache (design-based)
🔹 8. Dynamic Programming (DP)
Common Questions:
Fibonacci (recursion vs memoization vs tabulation)
0/1 Knapsack
Longest Common Subsequence / Substring
Longest Increasing Subsequence
Coin Change problem
🔹 9. Greedy Algorithms
Common Questions:
Activity selection
Fractional knapsack
Jump Game
Gas Station
🔹 10. Sliding Window & Two Pointers
Common Questions:
Maximum sum subarray of size K
Longest substring with k distinct characters
Container with most water
Trapping rain water
Comments
Post a Comment