Arrays
- Two Sum: Given an array of integers, return indices of the two numbers such that they add up to a specific target.
- Best Time to Buy and Sell Stock: Find the maximum profit you can achieve from buying and selling stocks.
- Contains Duplicate: Determine if any value appears at least twice in the array.
- Product of Array Except Self: Return an array where each element is the product of all elements except itself.
- Maximum Subarray: Find the contiguous subarray with the largest sum.
- Move Zeroes: Move all zeroes in an array to the end while maintaining the relative order of non-zero elements.
- Merge Intervals: Given a collection of intervals, merge all overlapping intervals.
- 3Sum: Find all unique triplets in an array that sum up to zero.
- Maximum Product Subarray: Find the contiguous subarray within an array that has the largest product.
- Find Minimum in Rotated Sorted Array: Given a rotated sorted array, find the minimum element.
Strings
- Longest Substring Without Repeating Characters: Find the length of the longest substring without repeating characters.
- Valid Anagram: Determine if two strings are anagrams of each other.
- Group Anagrams: Group an array of strings into anagrams.
- Longest Palindromic Substring: Find the longest palindromic substring in a string.
- String to Integer (atoi): Implement a function to convert a string to an integer.
- Implement strStr(): Locate a substring within a string.
- Count and Say: Generate the n-th term of the "count and say" sequence.
- Reverse String: Reverse a string in-place.
- Valid Parentheses: Determine if the input string’s parentheses are valid.
- Generate Parentheses: Generate all combinations of well-formed parentheses.
Linked Lists
- Reverse Linked List: Reverse a singly linked list.
- Merge Two Sorted Lists: Merge two sorted linked lists into one sorted list.
- Linked List Cycle: Detect if a linked list has a cycle.
- Remove Nth Node From End of List: Remove the n-th node from the end of a linked list.
- Palindrome Linked List: Determine if a linked list is a palindrome.
- Intersection of Two Linked Lists: Find the node where two linked lists intersect.
- Add Two Numbers: Add two numbers represented by linked lists.
- Swap Nodes in Pairs: Swap every two adjacent nodes in a linked list.
- Reorder List: Reorder a linked list so that nodes are in a specific sequence.
- LRU Cache: Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.
Trees
- Maximum Depth of Binary Tree: Find the maximum depth of a binary tree.
- Invert Binary Tree: Invert a binary tree.
- Validate Binary Search Tree: Check if a binary tree is a valid binary search tree.
- Symmetric Tree: Determine if a binary tree is symmetric.
- Binary Tree Level Order Traversal: Return the level order traversal of a binary tree’s nodes' values.
- Lowest Common Ancestor of a Binary Tree: Find the lowest common ancestor of two nodes in a binary tree.
- Serialize and Deserialize Binary Tree: Design an algorithm to serialize and deserialize a binary tree.
- Binary Tree Inorder Traversal: Perform an inorder traversal of a binary tree.
- Kth Smallest Element in a BST: Find the k-th smallest element in a binary search tree.
- Construct Binary Tree from Preorder and Inorder Traversal: Construct a binary tree from its preorder and inorder traversal.
Graphs
- Number of Islands: Count the number of islands in a 2D grid.
- Clone Graph: Clone an undirected graph.
- Course Schedule: Determine if you can finish all courses given prerequisites.
- Graph Valid Tree: Check if a graph is a valid tree.
- Pacific Atlantic Water Flow: Find all cells in a matrix where water can flow to both the Pacific and Atlantic oceans.
- Rotting Oranges: Given a grid of oranges, determine how long it takes for all oranges to rot.
- Word Ladder: Transform one word into another by changing one letter at a time.
- Minimum Height Trees: Find the root nodes of minimum height trees in an undirected graph.
- Max Area of Island: Find the maximum area of an island in a grid.
- Cheapest Flights Within K Stops: Find the cheapest price to travel from one city to another with at most K stops.
Dynamic Programming
- Climbing Stairs: Find the number of distinct ways to climb to the top of a staircase.
- Coin Change: Determine the minimum number of coins needed to make a certain amount.
- Longest Increasing Subsequence: Find the length of the longest increasing subsequence.
- House Robber: Maximize the amount of money you can rob without robbing adjacent houses.
- Unique Paths: Calculate how many unique paths exist in a grid from the top-left to the bottom-right corner.
- Edit Distance: Find the minimum number of operations required to convert one string into another.
- Maximum Product Subarray: Similar to earlier, but focused on products instead of sums.
- Decode Ways: Count the number of ways to decode a string.
- Jump Game: Determine if you can reach the last index of the array from the first index.
- Partition Equal Subset Sum: Determine if a set can be partitioned into two subsets with equal sums.
Backtracking
- Permutations: Generate all possible permutations of a list of numbers.
- Subsets: Find all possible subsets of a set.
- Combination Sum: Find all unique combinations that sum to a target.
- N-Queens: Solve the N-Queens puzzle.
- Word Search: Determine if a word exists in a 2D board.
- Combination Sum II: Similar to Combination Sum but with duplicates allowed.
- Palindrome Partitioning: Partition a string into palindromic substrings.
- Generate Parentheses: Generate all combinations of well-formed parentheses.
- Letter Combinations of a Phone Number: Generate all possible letter combinations from a phone number.
- Solve Sudoku: Implement a function to solve a Sudoku puzzle.
Miscellaneous
- Minimum Window Substring: Find the minimum window in a string that contains all characters of another string.
- Find First and Last Position of Element in Sorted Array: Find the starting and ending position of a given target value.
- Kth Largest Element in an Array: Find the k-th largest element in an unsorted array.
- Longest Repeating Character Replacement: Find the length of the longest substring with repeating characters.
- Sliding Window Maximum: Find the maximum in every sliding window of size k.
- Sum of Two Integers: Implement addition without using operators.
- Number of Ways to Paint N × 3 Grid: Count the number of ways to paint a grid with certain conditions.
- Binary Number with Alternating Bits: Check if a number has alternating bits.
- Maximum Length of Repeated Subarray: Find the maximum length of a subarray that appears in both arrays.
- Find All Anagrams in a String: Find all start indices of anagrams of a string in another string.
Advanced
- Design Search Autocomplete System: Create a system that suggests completions for user input.
- Maximal Rectangle: Find the largest rectangle containing only 1s in a binary matrix.
- Russian Doll Envelopes: Find the maximum number of envelopes you can Russian doll.
- Sliding Puzzle: Solve the sliding puzzle game.
- Top K Frequent Elements: Find the k most frequent elements in an array.
- Number of Subarrays with Sum K: Count the number of contiguous subarrays that sum to a given k.
- Longest Substring with At Most K Distinct Characters: Find the length of the longest substring with at most k distinct characters.
- Alien Dictionary: Determine the order of characters in an alien language.
- Task Scheduler: Find the least number of intervals needed to complete all tasks given cooldowns.
- Find Minimum in Rotated Sorted Array II: Find the minimum in a rotated sorted array that may contain duplicates.
Interview-Style Problems
- Binary Tree Maximum Path Sum: Find the maximum path sum in a binary tree.
- Search in Rotated Sorted Array: Search for a target in a rotated sorted array.
- Count of Smaller Numbers After Self: Count the number of smaller elements to the right of each element.
- Design an Excel Sheet: Implement a system to represent an Excel sheet.
- Word Break: Determine if a string can be segmented into words from a dictionary.
- Maximum Product of Three Numbers: Find the maximum product of any three numbers in an array.
- Delete Node in a Linked List: Delete a node (except the tail) from a linked list.
- Count Vowels Permutation: Count the number of valid strings that can be formed from a set of vowels.
- Subarray Sum Equals K: Count the number of continuous subarrays that sum to k.
- Rotate Array: Rotate an array to the right by k steps.