๐ Note: This curated list is your ultimate guide ๐ to acing MAANG+ interviews! Handpicked to cover the most essential Data Structures and Algorithms (DSA) concepts, these problems ensure you build a solid foundation for your coding interviews ๐.
- ๐ข Arrays
- ๐ค Strings
- ๐ฏ Two Pointers
- ๐ฅ Stack & Queue
- ๐ Recursion & Backtracking
- ๐ป Dynamic Programming
- ๐ฒ Tree
- ๐ Graph & BFS/DFS
- ๐ Binary Search
- ๐ Greedy
- โ Math
- ๐ฃ Bit Manipulation
- ๐ Linked List
- ๐๏ธ Heap/Priority Queue
- ๐ช Sliding Window / Interval Problems
-
- Concepts: Hashing, Single-pass solution
- Why Important: Classic question testing array traversal and hash map usage.
-
Best Time to Buy and Sell Stock
- Concepts: Sliding Window, Greedy
- Why Important: Tests ability to track min/max values in one pass.
-
- Concepts: Two-pointer approach
- Why Important: In-place array manipulation and partitioning technique.
-
Remove Duplicates from Sorted Array
- Concepts: In-place updates, Two pointers
- Why Important: Frequently asked for array manipulation.
-
- Concepts: Sorting, Two pointers
- Why Important: Tests array manipulation and avoiding duplicates.
-
- Concepts: Prefix and suffix products
- Why Important: Classic problem without using division.
-
- Concepts: Prefix sums, Hashing
- Why Important: Common pattern for solving subarray sum problems.
-
- Concepts: Lexicographical ordering, In-place transformations
- Why Important: Tests the understanding of array rearrangements.
-
- Concepts: Sorting, Two Pointers
- Why Important: Extension of 2-sum and 3-sum patterns.
-
- Concepts: Floyd's Tortoise and Hare (Cycle detection)
- Why Important: Pattern for detecting cycles with constant extra space.
-
- Concepts: String traversal, Comparison
- Why Important: Basic string processing pattern.
-
- Concepts: Two pointers
- Why Important: Palindrome checks are very common in interviews.
-
Longest Substring Without Repeating Characters
- Concepts: Sliding window, Hashing
- Why Important: Tests efficient sub-string search technique.
-
- Concepts: Hashing, Sorting
- Why Important: Common approach to grouping based on sorted keys.
-
Minimum Remove to Make Valid Parentheses
- Concepts: Stack-based approach, String building
- Why Important: Handling mismatched parentheses is a common interview theme.
-
- Concepts: Expand around center, Dynamic programming
- Why Important: Shows multiple ways (center expansion, DP) to handle string DP.
-
- Concepts: Greedy, Mapping
- Why Important: Classical string + math combination.
-
- Concepts: String manipulation, Splitting
- Why Important: Tests in-place reversal logic.
-
- Concepts: Simulation, String building
- Why Important: Pattern-based re-indexing.
-
- Concepts: Sliding window, Frequency counts
- Why Important: Widely asked, tests multiple edge cases in string processing.
-
- Concepts: Dutch National Flag problem
- Why Important: Common partitioning approach.
-
- Concepts: Greedy, Counting frequency
- Why Important: Great example of multi-pass scanning.
-
Longest Repeating Character Replacement
- Concepts: Sliding window, Frequency counts
- Why Important: Classic substring + two-pointer approach.
-
Maximum Number of Visible Points
- Concepts: Geometry, Two pointers
- Why Important: Showcases advanced two-pointer usage.
-
Subarrays with K Different Integers
- Concepts: Sliding window, HashMap
- Why Important: Important for subarray + distinct element problems.
-
- Concepts: Stack, Track min in O(1)
- Why Important: Implementation detail & design.
-
- Concepts: Monotonic stack
- Why Important: Very common interview question pattern.
-
- Concepts: Stack, Queue
- Why Important: Data structure transformation.
-
- Concepts: Monotonic stack
- Why Important: Extension of next greater element.
-
Evaluate Reverse Polish Notation
- Concepts: Stack usage
- Why Important: Expression parsing is common in interviews.
-
- Conceptual question
- Why Important: Understand the fundamental principle of recursive calls.
-
- Concepts: Divide and Conquer, Fast exponentiation
- Why Important: Basic recursion with optimization.
-
- Concepts: Backtracking
- Why Important: Foundation for generating combinations/powersets.
-
- Concepts: Backtracking, Swapping
- Why Important: Very commonly asked for generating permutations.
-
- Concepts: Backtracking, Branching
- Why Important: Tests handling repeated numbers in combinations.
-
Letter Combinations of a Phone Number
- Concepts: Backtracking, String building
- Why Important: Common pattern for recursion tree building.
-
- Concepts: DFS, Backtracking
- Why Important: 2D grid backtracking.
-
- Concepts: Backtracking, Constraint checks
- Why Important: Quintessential backtracking problem.
-
Partition to K Equal Sum Subsets
- Concepts: Backtracking, Subset sum
- Why Important: Tests optimization with memoization or backtracking prunes.
-
- Concepts: Backtracking on a grid
- Why Important: Interviewers love variations of grid-based backtracking.
-
- Concepts: Kadaneโs algorithm
- Why Important: Most asked in interviews. Classic DP example.
-
- Concepts: Fibonacci pattern
- Why Important: Intro to DP basics.
-
- Concepts: DP with adjacency constraints
- Why Important: 1D DP with skipping constraints.
-
- Concepts: Unbounded knapsack pattern
- Why Important: Classic DP problem for combination sums.
-
Longest Increasing Subsequence
- Concepts: Binary search optimization, DP
- Why Important: Another all-time favorite DP problem.
-
- Concepts: Expand around center, DP
- Why Important: String-based DP problem focusing on substring checks.
-
- Concepts: 2D DP
- Why Important: Common 2D grid DP approach.
-
- Concepts: String DP
- Why Important: Tests the understanding of sequential DP states.
-
- Concepts: String DP, Checking dictionary subsets
- Why Important: Realistic scenarioโcommonly asked.
-
- Concepts: Two-pointer or DP approach
- Why Important: Very frequently asked, tests ability to calculate trapped water by heights.
-
- Concepts: Tree traversal, Recursion
- Why Important: Classic easy question to warm up with trees.
-
- Concepts: BFS/DFS
- Why Important: Checking symmetry via recursion or queue-based BFS.
-
- Concepts: DFS, Using stack
- Why Important: Basic traversal pattern, iterative vs recursive.
-
- Concepts: DFS, Postorder
- Why Important: Tests recursion on subtrees.
-
Lowest Common Ancestor of a Binary Tree
- Concepts: DFS
- Why Important: LCA is a must-know pattern for many advanced tree problems.
-
- Concepts: DFS with range constraints, Inorder checks
- Why Important: Checking BST property is a standard interview question.
-
Binary Tree Level Order Traversal
- Concepts: BFS
- Why Important: Foundation for BFS on trees.
-
- Concepts: BFS or DFS
- Why Important: Classic BFS level-by-level variant.
-
- Concepts: Inorder traversal
- Why Important: BST property usage + traversal.
-
- Concepts: DFS, Postorder
- Why Important: Common tricky question involving returning multiple info up the recursion.
-
- Concepts: BFS/DFS
- Why Important: Fundamental grid connectivity.
-
- Concepts: Topological Sort, DFS
- Why Important: Must-know approach for scheduling/dependency problems.
-
- Concepts: Graph traversal, HashMap
- Why Important: Tests deep copy of graph structures.
-
- Concepts: BFS from boundary
- Why Important: BFS on 2D grids with region identification.
-
All Paths From Source to Target
- Concepts: DFS, Backtracking
- Why Important: Paths enumeration in a DAG.
-
- Concepts: BFS/DFS, Graph coloring
- Why Important: Classic bipartite check is widely asked.
-
- Concepts: Dijkstraโs Algorithm
- Why Important: Weighted graph shortest path in coding interviews.
-
- Concepts: Union-Find or DFS
- Why Important: Basic connectivity checks in graphs.
-
Critical Connections in a Network
- Concepts: Tarjanโs algorithm, Bridges in a graph
- Why Important: Advanced graph problem frequently asked in top-tier interviews.
-
- Concepts: BFS in word transformation
- Why Important: Classic BFS with transformation rules.
-
- Concepts: Iterative / Recursive search
- Why Important: Foundation of efficient searching.
-
Search in Rotated Sorted Array
- Concepts: Modified Binary Search
- Why Important: Very common pattern for rotating arrays.
-
Find First and Last Position of Element in Sorted Array
- Concepts: Binary search boundaries
- Why Important: Edge-case heavy problem, testing boundary conditions.
-
- Concepts: Binary search, Local maxima
- Why Important: Interviews love variations of peak-finding.
-
- Concepts: Binary search on partitions
- Why Important: Top-tier problem testing advanced binary search skills.
-
- Concepts: Greedy, Circuit completeness
- Why Important: Determining start point for a circular tour.
-
- Concepts: Greedy, Counting
- Why Important: Scheduler-type problems are popular.
-
- Concepts: Interval scheduling
- Why Important: Sorting intervals + selecting optimal sets is a frequent ask.
-
- Concepts: Stack-based greedy
- Why Important: Minimizing a numeric string with constraints.
-
- Concepts: Greedy distribution
- Why Important: Another commonly asked problem in big tech.
-
- Concepts: Overflow checks, Math manipulation
- Why Important: Edge cases with integer bounds.
-
- Concepts: Bitwise addition, String manipulation
- Why Important: Shows how to handle carry bits in strings.
-
- Concepts: Numerical palindrome check
- Why Important: Quick math problem, easy to slip on edge cases.
-
- Concepts: Bitwise check or repeated multiplication
- Why Important: Basic check thatโs often asked as a warm-up.
-
- Concepts: Parsing, Edge cases
- Why Important: Handling whitespace, signs, overflow.
-
- Concepts: Bitwise operations, Full adder logic
- Why Important: Fundamental for bit manipulation mastery.
-
- Concepts: Bit manipulation, n & (n-1)
- Why Important: Basic yet common in bit manipulation discussions.
-
- Concepts: Pointers, Iteration, Recursion
- Why Important: Fundamental reversal logic.
-
- Concepts: Linked List pointers
- Why Important: Basic merging of sorted data.
-
- Concepts: Cycle detection (Floydโs Tortoise and Hare)
- Why Important: Classic question testing cycle detection.
-
- Concepts: Finding cycle start
- Why Important: Extension to cycle detection, a must-know.
-
Intersection of Two Linked Lists
- Concepts: Dual-pointer technique
- Why Important: Common pattern for list intersections.
-
- Concepts: Midpoint, Reverse second half
- Why Important: Tests combined knowledge of reversal, pointers, and palindrome check.
-
- Concepts: Divide and Conquer, Priority Queue
- Why Important: Often asked in big tech, extends merging concept.
-
- Concepts: Max-heap or Quickselect
- Why Important: Classic top-k problem.
-
Kth Largest Element in an Array
- Concepts: Heap or Quickselect
- Why Important: Very common question for partial sorting.
-
- Concepts: Max-heap or counting
- Why Important: Tests building strings from frequency constraints.
-
- Concepts: DP, Min-heap
- Why Important: Interesting approach mixing DP and heap logic.
-
- Concepts: Sliding window with conditional expansion
- Why Important: Variation of subarray with constraints.
-
- Concepts: Sliding window with partial sums
- Why Important: Perfect demonstration of window with a twist.
Feel free to dive into each section for detailed problems and discussions designed to prepare you comprehensively for your upcoming interviews. Remember, practice makes perfect!
โญ Tip: Click the badges next to problem names to filter by difficulty!
We welcome pull requests and issues from the community! Check the contributing guidelines
for more details on how to propose enhancements or report bugs. If you find this resource helpful, please don't forget to star ๐ the repo!
If you found this repository helpful, please consider giving it a star โญ and sharing it with others preparing for their interviews!