Intermediate Hash Table Problems for Coding Interviews
120 intermediate Hash Table problems from real coding interviews, each with test cases you can run online. By difficulty they split into 0 basic, 120 intermediate and 0 advanced. The companies that ask them most often are Google, Amazon, Meta, Microsoft.
Solve a few problems of each level, name the pattern after each one and revisit the ones that needed a hint a week later. Practise stating the time and space complexity and the edge cases before you code.
Coding problems
- Kth Largest Element (Intermediate)
- Unique Grid Paths (Intermediate)
- Minimum in a Rotated Sorted Array (Intermediate)
- Sort Characters by Frequency (Intermediate)
- Minimum Deletions for Unique Frequencies (Intermediate)
- Find All Anagram Starts (Intermediate)
- Array Frequency Analysis (Intermediate)
- Maximum Sum of Distinct Window (Intermediate)
- Count Numbers With Unique Digits (Intermediate)
- Minimum Value in Bitonic Array (Intermediate)
- Smallest Number From Pattern (Intermediate)
- Minimum Height Trees (Intermediate)
- Lowest Common Ancestor With Parent Pointers (Intermediate)
- Tree Infection Time (Intermediate)
- Coin Change Ways (Intermediate)
- Minimum Swaps To Sort (Intermediate)
- Unique Paths With Obstacles (Intermediate)
- Deduplicate Sorted Linked List (Intermediate)
- Offline Distinct Range Queries (Intermediate)
- Count Substrings With Exactly K Distinct (Intermediate)
- BST Successor and Predecessor (Intermediate)
- Find Intersection of Three Sorted Arrays (Intermediate)
- Count Range Frequency Queries (Intermediate)
- Search a Nearly Sorted Array (Intermediate)
- Consistent Hash Ring (Intermediate)
- Kth Smallest Value in a BST (Intermediate)
- Lowest Common Ancestor of Two Values (Intermediate)
- Linked List Components (Intermediate)
- Tree From Preorder and Inorder (Intermediate)
- Tree From Inorder and Postorder (Intermediate)
- Trim a BST (Intermediate)
- Delete Node in a BST (Intermediate)
- Recover Swapped BST Values (Intermediate)
- Flip Equivalent Binary Trees (Intermediate)
- LCA of Deepest Leaves (Intermediate)
- Binary Tree Coloring Game (Intermediate)
- BST From Preorder (Intermediate)
- Directions Between Two Tree Nodes (Intermediate)
- Unique Topological Order Check (Intermediate)
- Loud and Rich (Intermediate)
- Combination Sum IV (Intermediate)
- Knight Dialer (Intermediate)
- Longest String Chain (Intermediate)
- Extra Characters in a String (Intermediate)
- Group Shifted Strings Count (Intermediate)
- Longest Word in Dictionary (Intermediate)
- Validate Stack Sequences (Intermediate)
- Super Ugly Number (Intermediate)
- Reduce Array Size to Half (Intermediate)
- Least Unique Integers After K Removals (Intermediate)
- Find All Duplicates in an Array (Intermediate)
- 3Sum Triplets (Intermediate)
- 4Sum Count (Intermediate)
- Remove Duplicates Allowing Twice (Intermediate)
- Kth Smallest in a Sorted Matrix (Intermediate)
- Maximum Number of Removable Characters (Intermediate)
- Search in Rotated Sorted Array II (Intermediate)
- Permutations of Distinct Values (Intermediate)
- Combination Sum (Intermediate)
- Combination Sum II (Intermediate)
- Max Length of Concatenated Unique Characters (Intermediate)
- Detect Squares (Intermediate)
- Food Rating System (Intermediate)
- Frequency Tracker (Intermediate)
- Count Number of Teams (Intermediate)
- Good Ways to Split a String (Intermediate)
- Number of Boomerangs (Intermediate)
- Minimum Area Rectangle (Intermediate)
- Construct Maximum Binary Tree (Intermediate)
- Convert BST to Greater Tree (Intermediate)
- Delete Nodes and Return Forest Sizes (Intermediate)
- Balance a Binary Search Tree (Intermediate)
- Create Binary Tree From Descriptions (Intermediate)
- Minimum Swaps to Sort Tree Levels (Intermediate)
- Closest Leaf to a Target (Intermediate)
- Count Root-to-Leaf Paths With Distinct Values (Intermediate)
- Min Cost to Connect All Points (Intermediate)
- Minimum Path Cost in a Grid (Intermediate)
- Restore Array From Adjacent Pairs (Intermediate)
- Unique Length-3 Palindromic Subsequences (Intermediate)
Related
Frequently asked questions
How do I get good at hash table problems?
Practise by level, name the pattern after you solve each problem and review the ones you needed hints for. The list is ordered so you can start with the basic ones.
Can I run hash table problems online here?
Yes. Each problem opens in an editor that runs your code against test cases in Java, Python, C++, Go, JavaScript and more.