Talentd
FleetCode
Make and follow sheets.Sign in

Hash Table Problems (797)

Problems tagged with Hash Table. Start with the easy ones, then move to medium and hard.

190 Easy473 Medium134 Hard

Learn these first

1
Array

Most hash table problems iterate through arrays while storing or checking values in a map. Understanding array traversal and indexing helps you apply hash-based optimizations effectively.

2
String

Many interview questions combine hash tables with string processing, such as counting characters, detecting anagrams, or tracking substring patterns.

3
Hash Function

Learning how hash functions work explains how keys are mapped to indices and why collisions occur. This knowledge improves your understanding of performance and implementation details.

4
Sliding Window

Sliding window techniques often rely on hash maps to maintain frequency counts or track elements within a dynamic range of indices.

TitleSolutionAcceptDifficultyTopics
554. Brick WallVideo
Solution56.1%Medium
Array, Hash Table· 5 companies
Solution48.2%Medium
Array, Hash Table +1· 47 companies
Solution49.8%Medium
Hash Table, Sliding Window +2· 16 companies
Solution71.5%Easy
Array, Hash Table· 3 companies
582. Kill ProcessVideoPremium
Solution70.4%Medium
Array, Breadth-First Search +3· 4 companies
Solution48.0%Hard
Design, Hash Table +3· 16 companies
Solution65.1%Easy
Array, Counting +3· 7 companies
Solution60.8%Easy
Array, Hash Table +1· 4 companies
Solution67.6%Medium
Array, Hash Table +1· 7 companies
616. Add Bold Tag in StringVideoPremium
Solution51.4%Medium
Array, Hash Table +3· 4 companies
621. Task SchedulerVideo
Solution64.0%Medium
Array, Counting +4· 24 companies
635. Design Log Storage SystemVideoPremium
Solution59.8%Medium
Design, Hash Table +2· 4 companies
645. Set MismatchVideo
Solution43.4%Easy
Array, Bit Manipulation +2· 7 companies
648. Replace WordsVideo
Solution68.7%Medium
Array, Hash Table +2· 4 companies
Solution60.6%Medium
Solution52.7%Medium
Array, Greedy +2· 2 companies
666. Path Sum IVVideoPremium
Solution63.1%Medium
Array, Binary Tree +3· 1 company
Solution58.4%Medium
Depth-First Search, Design +3· 2 companies
677. Map Sum PairsVideo
Solution57.4%Medium
Design, Hash Table +2· 3 companies
681. Next Closest TimeVideoPremium
Solution46.8%Medium
Backtracking, Enumeration +2· 1 company
Solution69.4%Medium
Array, Breadth-First Search +3· 6 companies
Solution60.6%Medium
Bucket Sort, Counting +5· 23 companies
Solution62.8%Medium
Solution58.8%Easy
Array, Hash Table· 12 companies
705. Design HashSetVideo
Solution67.9%Easy
Array, Design +3· 6 companies
706. Design HashMapVideo
Solution66.5%Easy
Array, Design +3· 13 companies
Solution35.4%Hard
Array, Binary Search +4· 3 companies
Solution55.2%Medium
Array, Hash Table +3· 3 companies
721. Accounts MergeVideo
Solution62.2%Medium
Array, Breadth-First Search +5· 17 companies
726. Number of AtomsVideo
Solution65.1%Hard
Hash Table, Sorting +2· 8 companies
734. Sentence SimilarityVideoPremium
Solution44.5%Easy
Array, Hash Table +1· 1 company
Solution54.1%Hard
Hash Table, Recursion +2· 4 companies
737. Sentence Similarity IIVideoPremium
Solution51.2%Medium
Array, Breadth-First Search +4· 4 companies
740. Delete and EarnVideo
Solution57.7%Medium
Array, Dynamic Programming +1· 12 companies
Solution41.2%Hard
Array, Design +3· 3 companies
Solution63.5%Easy
Array, Hash Table +1· 1 company
752. Open the LockVideo
Solution61.2%Medium
Array, Breadth-First Search +2· 15 companies
758. Bold Words in StringVideoPremium
Solution53.2%Medium
Array, Hash Table +3· 1 company
760. Find Anagram MappingsVideoPremium
Solution83.8%Easy
Array, Hash Table· 1 company
Solution81.8%Medium
Greedy, Hash Table +2· 9 companies
Solution57.5%Medium
Counting, Greedy +4· 20 companies
Solution49.8%Hard
Hash Table, Math +3· 3 companies
Solution89.5%Easy
Hash Table, String· 6 companies
Solution58.0%Medium
Array, Greedy +2· 8 companies
Solution72.3%Medium
Hash Table, Sorting +1· 5 companies
Solution50.8%Medium
Array, Binary Search +5· 9 companies
Solution83.6%Easy
Array, Hash Table +1· 3 companies
Showing 101–150 of 797

More about Hash Table

A Hash Table is one of the most powerful and frequently used data structures in coding interviews. It stores key–value pairs and uses a hashing function to map keys to indices, allowing operations like lookup, insertion, and deletion to run in O(1) average time. Because of this speed, hash tables are widely used for solving problems that involve counting, frequency tracking, deduplication, and fast lookups.

In technical interviews, hash tables appear in dozens of classic questions. Many well‑known problems—such as Two Sum, grouping anagrams, or finding duplicates—are solved efficiently using hash-based approaches. Companies like Amazon, Google, and Meta frequently test whether candidates recognize when a brute-force approach can be optimized with a hash map. Practicing these patterns helps you transform an O(n²) solution into an O(n) one.

Hash tables are often combined with other data structure and algorithm concepts. For example, you might pair them with Array traversal to store seen elements, or use them with String manipulation to track character frequencies. More advanced problems mix hash maps with Sliding Window techniques for substring optimization or with Prefix Sum to quickly detect subarray conditions. Understanding how these ideas interact is key to mastering modern interview questions.

Common hash table problem patterns include:

  • Frequency counting: Track how often elements appear in arrays or strings.
  • Complement lookups: Store previously seen values to find pairs quickly.
  • Grouping and classification: Organize items such as anagrams or categories.
  • Caching results: Avoid repeated computation by storing intermediate results.
  • Index mapping: Record positions of elements to detect patterns in sequences.

You should consider using a hash table whenever a problem requires fast membership checks, counting occurrences, or mapping relationships between values. FleetCode provides ranging from beginner to advanced, each with detailed explanations and complexity analysis so you can build real interview confidence.

Hash Table: common questions

What are common Hash Table problem patterns?

Common patterns include frequency counting, complement lookups (like Two Sum), grouping elements, caching results, and mapping indices. Many advanced questions combine these with techniques like sliding windows or prefix sums.

Is Hash Table important for FAANG interviews?

Yes. Hash tables are among the most commonly tested data structures in FAANG-style coding interviews. They frequently appear in array, string, and optimization problems because they reduce time complexity from O(n²) to O(n).

What is the best way to learn Hash Table in DSA?

Start by understanding how key-value storage and hashing work, then practice simple lookup and counting problems. After that, learn patterns such as complement search, grouping, and frequency maps. Solving progressively harder problems helps develop pattern recognition.

What is the time complexity of Hash Table operations?

In average cases, insertion, deletion, and lookup in a hash table run in O(1) time. However, collisions can degrade performance to O(n) in worst cases. Good hash functions and resizing strategies keep operations close to constant time.

How many Hash Table problems should I solve for interviews?

Start with basic frequency and lookup questions, then move to combined patterns like sliding window or prefix sums. Consistent practice builds the intuition needed for interviews.

What are the best Hash Table problems for coding interviews?

Popular hash table interview problems include Two Sum, Group Anagrams, Longest Substring Without Repeating Characters, and Top K Frequent Elements. These questions test your ability to use constant‑time lookups to optimize brute-force solutions. Practicing 30–50 variations usually covers the most common patterns.