Problem Roadmap

megaphone

Red - Problems & Test Set UpGreen- Tested and Solution Video Created

1. Strings

Beginners:

Reverse a String: Practice string traversal and manipulation.
Check Palindrome: Learn about checking string equality.
Count Vowels and Consonants: Understand string iteration and conditionals.
Find the First Non-Repeating Character: Introduce hash maps for character counts.
String Concatenation: Basic string operations.

Intermediate:

Longest Common Prefix: Learn about string comparison and prefix matching.
Anagram Check: Practice sorting strings or using hash maps for frequency counts.
Longest Substring Without Repeating Characters: Introduce sliding window technique.
Implement strstr(): Understand string searching algorithms.
Count and Say Problem: Practice string construction and pattern recognition.

Advanced:

Wildcard Pattern Matching: Implement pattern matching with wildcards.
Edit Distance: Dynamic programming for string modification operations.
Rabin-Karp Algorithm: Learn efficient substring search using hashing.
Suffix Array and LCP Array Construction: Advanced string processing and sorting.
Longest Palindromic Substring: Dynamic programming and expanding around centers.

2. Arrays

Beginners:
Find Maximum and Minimum in an Array: Basic array traversal.
Rotate Array: Learn array manipulation and index calculations.
Remove Duplicates from Sorted Array: Practice using two-pointer technique.
Find the Missing Number: Understand arithmetic properties and XOR operation.
Merge Two Sorted Arrays: Practice merging techniques.
Intermediate:
Kadane’s Algorithm: Learn dynamic programming for maximum subarray sum.
Dutch National Flag Problem: Practice partitioning and sorting in-place.
Next Permutation: Understand lexicographic ordering.
Trapping Rain Water: Use two-pointer technique for calculating trapped water.
Product of Array Except Self: Implement prefix and suffix products.
Advanced:
Median of Two Sorted Arrays: Divide and conquer approach for finding median.
Maximum Subarray Sum with at Most k Deletions: Dynamic programming and optimization.
Subarray with Given Sum: Use hash maps and sliding window technique.
Find Minimum in Rotated Sorted Array: Implement binary search in rotated arrays.
Count Inversions in an Array: Use merge sort for counting inversions.

3. Linked List

Beginners:
Reverse a Linked List: Practice pointers manipulation.
Detect Loop in Linked List: Learn about Floyd’s cycle-finding algorithm.
Merge Two Sorted Linked Lists: Merge technique in linked lists.
Remove N-th Node from End: Use two-pointer technique.
Find Intersection Point of Two Linked Lists: Learn about list traversal and comparison.
Intermediate:
Reorder List: Practice linked list reordering.
Flatten a Multilevel Doubly Linked List: Understand stack usage in linked list.
Copy List with Random Pointer: Practice cloning complex linked structures.
Rotate List: Implement list rotations and reconnections.
Partition List: Use partitioning technique based on pivot values.
Advanced:
Reverse Nodes in k-Group: Implement complex pointer manipulation.
LRU Cache Implementation: Combine hash map with doubly linked list.
Sort a Linked List: Practice merge sort on linked list.
Add Two Numbers: Work with linked lists representing numbers.
Swap Nodes in Pairs: Practice node swapping and reconnection.

4. Stacks

Beginners:
Implement Stack Using Array/Linked List: Learn basic stack operations.
Check for Balanced Parentheses: Practice stack usage for matching symbols.
Evaluate Postfix Expression: Implement stack-based expression evaluation.
Reverse a String Using Stack: Use stack for reversing operations.
Sort a Stack: Practice sorting elements using another stack.
Intermediate:
Next Greater Element: Implement stack-based searching.
Design a Min Stack: Learn to keep track of minimum element.
Stock Span Problem: Practice stack-based range calculations.
Largest Rectangle in Histogram: Use stack for maximum area calculations.
Basic Calculator: Implement stack-based expression parsing.
Advanced:
Longest Valid Parentheses: Dynamic programming and stack for valid substrings.
Maximal Rectangle: Combine stack with dynamic programming for maximum area.
Expression Add Operators: Use backtracking and stack for operator insertion.
Basic Calculator II: Advanced stack-based expression parsing.
Asteroid Collision: Use stack for collision handling.

5. Queues

Beginners:
Implement Queue Using Array/Linked List: Learn basic queue operations.
Circular Queue Implementation: Understand circular buffer concept.
Implement Stack Using Queues: Learn queue manipulations.
Generate Binary Numbers from 1 to n: Practice using queues for sequence generation.
Interleave First Half with Second Half: Use queue for reordering.
Intermediate:
Sliding Window Maximum: Implement deque for efficient window calculations.
Rotten Oranges: Use BFS for multi-source shortest path.
First Non-Repeating Character in Stream: Implement queue with character counting.
Design Hit Counter: Learn to design a time-based counter using queues.
LRU Cache: Combine doubly linked list with hash map for efficient caching.
Advanced:
Shortest Path in Binary Matrix: Use BFS for shortest path calculations.
Alien Dictionary: Implement topological sorting using BFS.
Jump Game VI: Use deque for optimized range searching.
Minimum Number of Refueling Stops: Use priority queue for greedy optimization.
Bus Routes: Use BFS for finding shortest route in graph.

6. Hash Tables

Beginners:
Two Sum Problem: Use hash map for complement searching.
Find Duplicate in Array: Practice element counting with hash map.
Group Anagrams: Implement hash map for grouping strings.
Subarray Sum Equals K: Use prefix sums and hash map.
Happy Number: Detect cycles using hash set.
Intermediate:
Longest Consecutive Sequence: Use hash set for sequence tracking.
Find All Anagrams in a String: Sliding window and hash map for anagram finding.
Valid Sudoku: Implement hash sets for validation.
Top K Frequent Elements: Use hash map and heap for frequency counting.
Word Pattern: Use hash map for pattern matching.
Advanced:
Design Twitter: Use hash maps for social network design.
Substring with Concatenation of All Words: Sliding window and hash map for substring search.
Minimum Window Substring: Use sliding window and hash map for optimal substring.
Max Points on a Line: Use hash map for geometric calculations.
Palindromic Substrings: Dynamic programming with hash map for palindrome count.

7. Trees

Beginners:

Inorder Traversal: Practice tree traversal.
Maximum Depth of Binary Tree: Learn depth calculation.
Symmetric Tree: Understand tree mirroring.
Path Sum: Learn recursive path checking.
Lowest Common Ancestor of BST: Practice binary search tree properties.

Intermediate:

Binary Tree Level Order Traversal: Implement BFS in trees.
Construct Binary Tree from Preorder and Inorder Traversal: Learn tree construction.
Flatten Binary Tree to Linked List: Practice tree flattening.
Validate Binary Search Tree: Understand BST properties.
Kth Smallest Element in BST: Use inorder traversal for k-th smallest element.

Advanced:

Serialize and Deserialize Binary Tree: Implement tree serialization.
Binary Tree Maximum Path Sum: Use dynamic programming for path sum.
Recover Binary Search Tree: Correct BST with swapped nodes.
Binary Tree Cameras: Use dynamic programming for optimal camera placement.
Word Ladder II: Use BFS for shortest transformation sequence.

8. Heaps

Beginners:
Implement Min/Max Heap: Learn basic heap operations (insert, delete, extract).
Find Kth Largest Element: Use a min-heap to find the k-th largest element.
Merge K Sorted Lists: Practice merging multiple sorted lists using a min-heap.
Top K Frequent Elements: Use a heap for finding the k most frequent elements.
K Closest Points to Origin: Implement a max-heap for finding the closest points to the origin.
Intermediate:
Find Median from Data Stream: Use two heaps (min-heap and max-heap) to maintain the median of a stream of numbers.
Sliding Window Median: Implement sliding window median calculation using heaps.
Reorganize String: Use a max-heap to rearrange characters in a string to avoid consecutive duplicates.
Task Scheduler: Use a heap to schedule tasks with cooling periods efficiently.
Maximal Sliding Window: Use a max-heap to find the maximum value in each sliding window of a given size.
Advanced:
Top K Frequent Words: Use a min-heap to find the most frequent words in a text.
Median of Two Sorted Arrays: Utilize heaps and binary search to find the median of two sorted arrays.
Find Smallest Range Covering Elements from K Lists: Use a min-heap to find the smallest range that includes at least one number from each of the k lists.
Kth Smallest Element in a Sorted Matrix: Use a min-heap to efficiently find the k-th smallest element in a row and column sorted matrix.
Employee Free Time: Use a min-heap to merge intervals and find common free time slots for employees.

9. Graphs

Beginners:
Graph Representation: Learn how to represent graphs using adjacency matrices and lists.
Depth-First Search (DFS): Practice basic graph traversal using DFS.
Breadth-First Search (BFS): Practice basic graph traversal using BFS.
Detect Cycle in Undirected Graph: Use DFS to detect cycles.
Connected Components: Use DFS or BFS to find all connected components in a graph.
Intermediate:
Topological Sort: Implement topological sorting for directed acyclic graphs (DAGs).
Shortest Path in Unweighted Graph: Use BFS to find the shortest path in an unweighted graph.
Dijkstra's Algorithm: Implement Dijkstra's algorithm for shortest paths in weighted graphs.
Minimum Spanning Tree (Prim's/Kruskal's): Implement MST algorithms.
Detect Cycle in Directed Graph: Use DFS and graph coloring to detect cycles.
Advanced:
Bellman-Ford Algorithm: Implement Bellman-Ford for shortest paths with negative weights.
Floyd-Warshall Algorithm: Use this algorithm for all-pairs shortest paths.
Johnson's Algorithm: Implement Johnson’s algorithm for all-pairs shortest paths in sparse graphs.
Maximum Flow (Ford-Fulkerson/Edmonds-Karp): Implement algorithms to find the maximum flow in a network.
Graph Coloring: Use backtracking and greedy techniques for graph coloring problems.

10. Tries

Beginners:
Insert and Search Operations: Learn the basic operations of a Trie (insert, search).
Autocomplete System: Implement a simple autocomplete system using Tries.
Count Words with Given Prefix: Use Tries to count words with a given prefix.
Delete Operation in Trie: Implement the delete operation in a Trie.
Find Longest Common Prefix: Use a Trie to find the longest common prefix of a set of strings.
Intermediate:
Word Search II: Implement a Trie to solve the word search problem on a 2D board.
Implement Magic Dictionary: Use a Trie to design a dictionary with search functionality that supports one modification.
Replace Words in a Sentence: Use a Trie to replace words in a sentence with their root forms.
Concatenated Words: Use a Trie to find all concatenated words in a given list.
Palindrome Pairs: Use a Trie to find all pairs of words that form a palindrome when concatenated.
Advanced:
Maximum XOR of Two Numbers in an Array: Use a Trie to find the maximum XOR of two numbers in an array.
Design Search Autocomplete System: Implement a more complex autocomplete system that supports weights and sorting.
Stream of Characters: Use a Trie to design a data structure that checks if a sequence of characters forms a word.
Longest Word in Dictionary: Use a Trie to find the longest word in a dictionary that can be built one character at a time.
Search Suggestion System: Use a Trie to create a search suggestion system that suggests products based on a search query.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.