Skip to content

Ace your MAANG+ interviews with this curated list of 100 essential DSA problems. From arrays to graphs, master every concept with detailed solutions and expert tips. Start your path to a top-tier tech job today!

License

Notifications You must be signed in to change notification settings

VikashPR/MAANG-Interview-Prep-100-DSA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ 100 Must-Solve DSA Questions for MAANG+ Interviews ๐ŸŒŸ

GitHub stars GitHub forks PRs Welcome License

DSA-Awesome Made withMarkdown Open Source Love png1 GitHub issues GitHub contributors

๐Ÿ“ 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 ๐Ÿš€.

๐Ÿ“š Table of Contents

  1. ๐Ÿ”ข Arrays
  2. ๐Ÿ”ค Strings
  3. ๐Ÿ‘ฏ Two Pointers
  4. ๐Ÿฅž Stack & Queue
  5. ๐Ÿ”„ Recursion & Backtracking
  6. ๐Ÿ’ป Dynamic Programming
  7. ๐ŸŒฒ Tree
  8. ๐Ÿ”— Graph & BFS/DFS
  9. ๐Ÿ” Binary Search
  10. ๐Ÿ“ˆ Greedy
  11. โž• Math
  12. ๐Ÿ”ฃ Bit Manipulation
  13. ๐Ÿ”— Linked List
  14. ๐Ÿ—๏ธ Heap/Priority Queue
  15. ๐ŸชŸ Sliding Window / Interval Problems

LinkedIn profile Personal Website

๐Ÿ”ข Array

  1. Two Sum Easy

    • Concepts: Hashing, Single-pass solution
    • Why Important: Classic question testing array traversal and hash map usage.
  2. Best Time to Buy and Sell Stock Easy

    • Concepts: Sliding Window, Greedy
    • Why Important: Tests ability to track min/max values in one pass.
  3. Move Zeroes Easy

    • Concepts: Two-pointer approach
    • Why Important: In-place array manipulation and partitioning technique.
  4. Remove Duplicates from Sorted Array Easy

    • Concepts: In-place updates, Two pointers
    • Why Important: Frequently asked for array manipulation.
  5. 3Sum Medium

    • Concepts: Sorting, Two pointers
    • Why Important: Tests array manipulation and avoiding duplicates.
  6. Product of Array Except Self Medium

    • Concepts: Prefix and suffix products
    • Why Important: Classic problem without using division.
  7. Subarray Sum Equals K Medium

    • Concepts: Prefix sums, Hashing
    • Why Important: Common pattern for solving subarray sum problems.
  8. Next Permutation Medium

    • Concepts: Lexicographical ordering, In-place transformations
    • Why Important: Tests the understanding of array rearrangements.
  9. 4Sum Medium

    • Concepts: Sorting, Two Pointers
    • Why Important: Extension of 2-sum and 3-sum patterns.
  10. Find the Duplicate Number Medium

    • Concepts: Floyd's Tortoise and Hare (Cycle detection)
    • Why Important: Pattern for detecting cycles with constant extra space.

๐Ÿ”ค Strings

  1. Longest Common Prefix Easy

    • Concepts: String traversal, Comparison
    • Why Important: Basic string processing pattern.
  2. Valid Palindrome II Easy

    • Concepts: Two pointers
    • Why Important: Palindrome checks are very common in interviews.
  3. Longest Substring Without Repeating Characters Medium

    • Concepts: Sliding window, Hashing
    • Why Important: Tests efficient sub-string search technique.
  4. Group Anagrams Medium

    • Concepts: Hashing, Sorting
    • Why Important: Common approach to grouping based on sorted keys.
  5. Minimum Remove to Make Valid Parentheses Medium

    • Concepts: Stack-based approach, String building
    • Why Important: Handling mismatched parentheses is a common interview theme.
  6. Longest Palindromic Substring Medium

    • Concepts: Expand around center, Dynamic programming
    • Why Important: Shows multiple ways (center expansion, DP) to handle string DP.
  7. Integer to Roman Medium

    • Concepts: Greedy, Mapping
    • Why Important: Classical string + math combination.
  8. Reverse Words in a String Medium

    • Concepts: String manipulation, Splitting
    • Why Important: Tests in-place reversal logic.
  9. Zigzag Conversion Medium

    • Concepts: Simulation, String building
    • Why Important: Pattern-based re-indexing.
  10. Minimum Window Substring Hard

    • Concepts: Sliding window, Frequency counts
    • Why Important: Widely asked, tests multiple edge cases in string processing.

๐Ÿ‘ฏ Two Pointers

  1. Sort Colors Medium

    • Concepts: Dutch National Flag problem
    • Why Important: Common partitioning approach.
  2. Partition Labels Medium

    • Concepts: Greedy, Counting frequency
    • Why Important: Great example of multi-pass scanning.
  3. Longest Repeating Character Replacement Medium

    • Concepts: Sliding window, Frequency counts
    • Why Important: Classic substring + two-pointer approach.
  4. Maximum Number of Visible Points Hard

    • Concepts: Geometry, Two pointers
    • Why Important: Showcases advanced two-pointer usage.
  5. Subarrays with K Different Integers Hard

    • Concepts: Sliding window, HashMap
    • Why Important: Important for subarray + distinct element problems.

๐Ÿฅž Stack & Queue

  1. Min Stack Easy

    • Concepts: Stack, Track min in O(1)
    • Why Important: Implementation detail & design.
  2. Next Greater Element I Easy

    • Concepts: Monotonic stack
    • Why Important: Very common interview question pattern.
  3. Implement Queue using Stacks Easy

    • Concepts: Stack, Queue
    • Why Important: Data structure transformation.
  4. Daily Temperatures Medium

    • Concepts: Monotonic stack
    • Why Important: Extension of next greater element.
  5. Evaluate Reverse Polish Notation Medium

    • Concepts: Stack usage
    • Why Important: Expression parsing is common in interviews.

๐Ÿ”„ Recursion & Backtracking

  1. What is Recursion? Conceptual

    • Conceptual question
    • Why Important: Understand the fundamental principle of recursive calls.
  2. Pow(x, n) Medium

    • Concepts: Divide and Conquer, Fast exponentiation
    • Why Important: Basic recursion with optimization.
  3. Subsets Medium

    • Concepts: Backtracking
    • Why Important: Foundation for generating combinations/powersets.
  4. Permutations Medium

    • Concepts: Backtracking, Swapping
    • Why Important: Very commonly asked for generating permutations.
  5. Combination Sum Medium

    • Concepts: Backtracking, Branching
    • Why Important: Tests handling repeated numbers in combinations.
  6. Letter Combinations of a Phone Number Medium

    • Concepts: Backtracking, String building
    • Why Important: Common pattern for recursion tree building.
  7. Word Search Medium

    • Concepts: DFS, Backtracking
    • Why Important: 2D grid backtracking.
  8. N-Queens Hard

    • Concepts: Backtracking, Constraint checks
    • Why Important: Quintessential backtracking problem.
  9. Partition to K Equal Sum Subsets Medium

    • Concepts: Backtracking, Subset sum
    • Why Important: Tests optimization with memoization or backtracking prunes.
  10. Rat in a Maze (Classic) Medium

    • Concepts: Backtracking on a grid
    • Why Important: Interviewers love variations of grid-based backtracking.

๐Ÿ’ป Dynamic Programming

  1. Maximum Subarray Easy

    • Concepts: Kadaneโ€™s algorithm
    • Why Important: Most asked in interviews. Classic DP example.
  2. Climbing Stairs Easy

    • Concepts: Fibonacci pattern
    • Why Important: Intro to DP basics.
  3. House Robber Medium

    • Concepts: DP with adjacency constraints
    • Why Important: 1D DP with skipping constraints.
  4. Coin Change Medium

    • Concepts: Unbounded knapsack pattern
    • Why Important: Classic DP problem for combination sums.
  5. Longest Increasing Subsequence Medium

    • Concepts: Binary search optimization, DP
    • Why Important: Another all-time favorite DP problem.
  6. Palindrome Substrings Medium

    • Concepts: Expand around center, DP
    • Why Important: String-based DP problem focusing on substring checks.
  7. Maximal Square Medium

    • Concepts: 2D DP
    • Why Important: Common 2D grid DP approach.
  8. Decode Ways Medium

    • Concepts: String DP
    • Why Important: Tests the understanding of sequential DP states.
  9. Word Break Medium

    • Concepts: String DP, Checking dictionary subsets
    • Why Important: Realistic scenarioโ€”commonly asked.
  10. Trapping Rain Water Hard

    • Concepts: Two-pointer or DP approach
    • Why Important: Very frequently asked, tests ability to calculate trapped water by heights.

๐ŸŒฒ Tree

  1. Invert Binary Tree Easy

    • Concepts: Tree traversal, Recursion
    • Why Important: Classic easy question to warm up with trees.
  2. Symmetric Tree Easy

    • Concepts: BFS/DFS
    • Why Important: Checking symmetry via recursion or queue-based BFS.
  3. Binary Tree Inorder Traversal Easy

    • Concepts: DFS, Using stack
    • Why Important: Basic traversal pattern, iterative vs recursive.
  4. Diameter of Binary Tree Easy

    • Concepts: DFS, Postorder
    • Why Important: Tests recursion on subtrees.
  5. Lowest Common Ancestor of a Binary Tree Medium

    • Concepts: DFS
    • Why Important: LCA is a must-know pattern for many advanced tree problems.
  6. Validate Binary Search Tree Medium

    • Concepts: DFS with range constraints, Inorder checks
    • Why Important: Checking BST property is a standard interview question.
  7. Binary Tree Level Order Traversal Medium

    • Concepts: BFS
    • Why Important: Foundation for BFS on trees.
  8. Binary Tree Right Side View Medium

    • Concepts: BFS or DFS
    • Why Important: Classic BFS level-by-level variant.
  9. Kth Smallest Element in a BST Medium

    • Concepts: Inorder traversal
    • Why Important: BST property usage + traversal.
  10. Binary Tree Maximum Path Sum Hard

    • Concepts: DFS, Postorder
    • Why Important: Common tricky question involving returning multiple info up the recursion.

๐Ÿ”— Graph & BFS/DFS

  1. Number of Islands Medium

    • Concepts: BFS/DFS
    • Why Important: Fundamental grid connectivity.
  2. Course Schedule II Medium

    • Concepts: Topological Sort, DFS
    • Why Important: Must-know approach for scheduling/dependency problems.
  3. Clone Graph Medium

    • Concepts: Graph traversal, HashMap
    • Why Important: Tests deep copy of graph structures.
  4. Shortest Bridge Medium

    • Concepts: BFS from boundary
    • Why Important: BFS on 2D grids with region identification.
  5. All Paths From Source to Target Medium

    • Concepts: DFS, Backtracking
    • Why Important: Paths enumeration in a DAG.
  6. Is Graph Bipartite? Medium

    • Concepts: BFS/DFS, Graph coloring
    • Why Important: Classic bipartite check is widely asked.
  7. Network Delay Time Medium

    • Concepts: Dijkstraโ€™s Algorithm
    • Why Important: Weighted graph shortest path in coding interviews.
  8. Number of Provinces Medium

    • Concepts: Union-Find or DFS
    • Why Important: Basic connectivity checks in graphs.
  9. Critical Connections in a Network Hard

    • Concepts: Tarjanโ€™s algorithm, Bridges in a graph
    • Why Important: Advanced graph problem frequently asked in top-tier interviews.
  10. Word Ladder Hard

    • Concepts: BFS in word transformation
    • Why Important: Classic BFS with transformation rules.

๐Ÿ” Binary Search

  1. Binary Search Easy

    • Concepts: Iterative / Recursive search
    • Why Important: Foundation of efficient searching.
  2. Search in Rotated Sorted Array Medium

    • Concepts: Modified Binary Search
    • Why Important: Very common pattern for rotating arrays.
  3. Find First and Last Position of Element in Sorted Array Medium

    • Concepts: Binary search boundaries
    • Why Important: Edge-case heavy problem, testing boundary conditions.
  4. Find Peak Element Medium

    • Concepts: Binary search, Local maxima
    • Why Important: Interviews love variations of peak-finding.
  5. Median of Two Sorted Arrays Hard

    • Concepts: Binary search on partitions
    • Why Important: Top-tier problem testing advanced binary search skills.

๐Ÿ“ˆ Greedy

  1. Gas Station Medium

    • Concepts: Greedy, Circuit completeness
    • Why Important: Determining start point for a circular tour.
  2. Task Scheduler Medium

    • Concepts: Greedy, Counting
    • Why Important: Scheduler-type problems are popular.
  3. Non-overlapping Intervals Medium

    • Concepts: Interval scheduling
    • Why Important: Sorting intervals + selecting optimal sets is a frequent ask.
  4. Remove K Digits Medium

    • Concepts: Stack-based greedy
    • Why Important: Minimizing a numeric string with constraints.
  5. Candy Hard

    • Concepts: Greedy distribution
    • Why Important: Another commonly asked problem in big tech.

โž• Math

  1. Reverse Integer Easy

    • Concepts: Overflow checks, Math manipulation
    • Why Important: Edge cases with integer bounds.
  2. Add Binary Easy

    • Concepts: Bitwise addition, String manipulation
    • Why Important: Shows how to handle carry bits in strings.
  3. Palindrome Number Easy

    • Concepts: Numerical palindrome check
    • Why Important: Quick math problem, easy to slip on edge cases.
  4. Power of Two Easy

    • Concepts: Bitwise check or repeated multiplication
    • Why Important: Basic check thatโ€™s often asked as a warm-up.
  5. String to Integer (atoi) Medium

    • Concepts: Parsing, Edge cases
    • Why Important: Handling whitespace, signs, overflow.

๐Ÿ”ฃ Bit Manipulation

  1. Sum of Two Integers Medium

    • Concepts: Bitwise operations, Full adder logic
    • Why Important: Fundamental for bit manipulation mastery.
  2. Count of 1 Bits Easy

    • Concepts: Bit manipulation, n & (n-1)
    • Why Important: Basic yet common in bit manipulation discussions.

๐Ÿ”— Linked List

  1. Reverse Linked List Easy

    • Concepts: Pointers, Iteration, Recursion
    • Why Important: Fundamental reversal logic.
  2. Merge Two Sorted Lists Easy

    • Concepts: Linked List pointers
    • Why Important: Basic merging of sorted data.
  3. Linked List Cycle Easy

    • Concepts: Cycle detection (Floydโ€™s Tortoise and Hare)
    • Why Important: Classic question testing cycle detection.
  4. Linked List Cycle II Medium

    • Concepts: Finding cycle start
    • Why Important: Extension to cycle detection, a must-know.
  5. Intersection of Two Linked Lists Easy

    • Concepts: Dual-pointer technique
    • Why Important: Common pattern for list intersections.
  6. Palindrome Linked List Medium

    • Concepts: Midpoint, Reverse second half
    • Why Important: Tests combined knowledge of reversal, pointers, and palindrome check.
  7. Merge k Sorted Lists Hard

    • Concepts: Divide and Conquer, Priority Queue
    • Why Important: Often asked in big tech, extends merging concept.

๐Ÿ—๏ธ Heap/Priority Queue

  1. K Closest Points to Origin Medium

    • Concepts: Max-heap or Quickselect
    • Why Important: Classic top-k problem.
  2. Kth Largest Element in an Array Medium

    • Concepts: Heap or Quickselect
    • Why Important: Very common question for partial sorting.
  3. Reorganize String Medium

    • Concepts: Max-heap or counting
    • Why Important: Tests building strings from frequency constraints.
  4. Ugly Number II Medium

    • Concepts: DP, Min-heap
    • Why Important: Interesting approach mixing DP and heap logic.

๐ŸชŸ Sliding Window / Interval Problems

  1. Max Consecutive Ones III Medium

    • Concepts: Sliding window with conditional expansion
    • Why Important: Variation of subarray with constraints.
  2. Grumpy Bookstore Owner Medium

    • 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!

๐Ÿ’ฌ Contributing

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!


๐Ÿ™Œ Support

If you found this repository helpful, please consider giving it a star โญ and sharing it with others preparing for their interviews!

About

Ace your MAANG+ interviews with this curated list of 100 essential DSA problems. From arrays to graphs, master every concept with detailed solutions and expert tips. Start your path to a top-tier tech job today!

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks