# Data Structures & Algorithms (DSA)

A practical guide to core data structures and algorithms, with curated practice questions grouped by difficulty. Use this page as the starting point, then dive into the dedicated guides below for deeper explanations and code examples.

# Guides

  • Sorting Algorithms — Merge, Quick, Bubble, Selection, Insertion, Heap, Counting, and Radix sort with complexity analysis and Python examples.
  • Divide and Conquer — Top 50 — The 50 most frequently asked divide-and-conquer problems, mapped to their closest LeetCode equivalents.
  • Algorithm Paradigms & Control Mechanisms — Divide and Conquer vs. Dynamic Programming vs. Greedy, plus sequencing, selection, and iteration fundamentals.

# How to Use the Practice Questions

Work through the Beginner set first to build comfort with core data structures (arrays, strings, hash maps, linked lists) before moving to the Intermediate set, which introduces multi-pointer techniques, trees, graphs, and dynamic programming. Each question links to its LeetCode page and lists the primary concept it tests.

# Beginner Level Questions

# Question Concept LeetCode Problem
1 Two Sum Hash Map Two Sum (opens new window)
2 Reverse a String Two Pointers Reverse String (opens new window)
3 Valid Palindrome Two Pointers / Strings Valid Palindrome (opens new window)
4 Contains Duplicate Hash Set Contains Duplicate (opens new window)
5 Valid Parentheses Stack Valid Parentheses (opens new window)
6 Merge Two Sorted Lists Linked List Merge Two Sorted Lists (opens new window)
7 Remove Duplicates from Sorted Array Two Pointers Remove Duplicates from Sorted Array (opens new window)
8 Best Time to Buy and Sell Stock Sliding Window / Greedy Best Time to Buy and Sell Stock (opens new window)
9 Climbing Stairs Basic Dynamic Programming Climbing Stairs (opens new window)
10 Binary Search Binary Search Binary Search (opens new window)
11 Valid Anagram Hash Map Valid Anagram (opens new window)
12 Missing Number Math / Bit Manipulation Missing Number (opens new window)
13 Move Zeroes Two Pointers Move Zeroes (opens new window)
14 Single Number Bit Manipulation Single Number (opens new window)
15 Majority Element Boyer-Moore Voting Majority Element (opens new window)
16 Linked List Cycle Fast & Slow Pointers Linked List Cycle (opens new window)
17 Reverse Linked List Linked List Reverse Linked List (opens new window)
18 Maximum Depth of Binary Tree Trees / DFS Maximum Depth of Binary Tree (opens new window)
19 Fibonacci Number Recursion / DP Fibonacci Number (opens new window)
20 Find the Index of the First Occurrence in a String String Matching Find the Index of the First Occurrence in a String (opens new window)

# Intermediate Level Questions

# Question Concept LeetCode Problem
1 Longest Substring Without Repeating Characters Sliding Window Longest Substring Without Repeating Characters (opens new window)
2 3Sum Two Pointers / Sorting 3Sum (opens new window)
3 Group Anagrams Hash Map Group Anagrams (opens new window)
4 Product of Array Except Self Prefix / Suffix Products Product of Array Except Self (opens new window)
5 Binary Tree Level Order Traversal BFS / Trees Binary Tree Level Order Traversal (opens new window)
6 Kth Largest Element in an Array Heap / QuickSelect Kth Largest Element in an Array (opens new window)
7 Course Schedule Graph / Topological Sort Course Schedule (opens new window)
8 Coin Change Dynamic Programming Coin Change (opens new window)
9 Longest Increasing Subsequence Dynamic Programming Longest Increasing Subsequence (opens new window)
10 Search in Rotated Sorted Array Modified Binary Search Search in Rotated Sorted Array (opens new window)
11 Maximum Subarray (Kadane's Algorithm) Dynamic Programming / Greedy Maximum Subarray (opens new window)
12 Word Search Backtracking / DFS Word Search (opens new window)
13 Number of Islands Graph / BFS-DFS Number of Islands (opens new window)
14 Validate Binary Search Tree Trees Validate Binary Search Tree (opens new window)
15 Top K Frequent Elements Heap / Hash Map Top K Frequent Elements (opens new window)
16 Subsets Backtracking Subsets (opens new window)
17 Permutations Backtracking Permutations (opens new window)
18 House Robber Dynamic Programming House Robber (opens new window)
19 Combination Sum Backtracking Combination Sum (opens new window)
20 Clone Graph Graph / DFS-BFS Clone Graph (opens new window)

# Top 50 Most Asked Divide and Conquer Problems

See the full list on the Divide and Conquer — Top 50 page.