Skip to content

Interview Solver

FeaturesPricingHelp
Sign In
FeaturesPricingHelpSign In
Interview Questions›Topics›Hash Function

Hash Function Interview Questions

Master 33 hash function problems frequently asked in technical interviews. These questions test your understanding of hash functionconcepts and are essential for coding interview success.

33
Total Problems
4
Easy
14
Medium
15
Hard

Related Topics

Rolling HashStringArrayHash TableString MatchingZ AlgorithmBinary SearchTrie
#694MediumFrequency: 86.6%

Number of Distinct Islands

Asked at TikTok
ArrayHash TableDepth-First SearchBreadth-First SearchUnion-FindSortingMatrixHash Function
#1
Rank
#336HardFrequency: 78.6%

Palindrome Pairs

Asked at Airbnb
ArrayHash TableStringTrieHash Function
#2
Rank
#1697MediumFrequency: 65.5%

Strings Differ by One Character

Asked at Airbnb
Hash TableStringRolling HashHash Function
#3
Rank
#817EasyFrequency: 61.4%

Design HashMap

Asked at TikTok
ArrayHash TableLinked ListDesignHash Function
#4
Rank
#187MediumFrequency: 57.5%

Repeated DNA Sequences

Asked at LinkedIn
Hash TableStringBit ManipulationSliding WindowRolling HashHash FunctionZ AlgorithmBoyer–Moore String-Search Algorithm
#5
Rank
#3441MediumFrequency: 55.1%

Equalize Strings by Adding or Removing Characters at Ends

Asked at Salesforce
StringBinary SearchDynamic ProgrammingSliding WindowHash Function
#6
Rank
#535MediumFrequency: 49.9%

Encode and Decode TinyURL

Asked at Uber
Hash TableStringDesignHash Function
#7
Rank
#2339MediumFrequency: 47.5%

K Divisible Elements Subarrays

Asked at Uber
ArrayHash TableTrieRolling HashHash FunctionEnumeration
#8
Rank
#3333MediumFrequency: 47.5%

Find Pattern in Infinite Stream I

Asked at Uber
ArraySliding WindowRolling HashString MatchingInteractiveHash Function
#9
Rank
#3352HardFrequency: 47.5%

Find Pattern in Infinite Stream II

Asked at Uber
ArraySliding WindowRolling HashString MatchingInteractiveHash Function
#10
Rank
#214HardFrequency: 38.2%

Shortest Palindrome

Asked at Google
StringRolling HashString MatchingHash FunctionManacherZ AlgorithmKnuth–Morris–Pratt Algorithm
#11
Rank
#1122HardFrequency: 33%

Longest Duplicate Substring

Asked at TikTok
StringBinary SearchSliding WindowRolling HashSuffix ArrayHash FunctionSuffix AutomatonSuffix TreeZ AlgorithmBoyer–Moore String-Search Algorithm
#12
Rank
#572EasyFrequency: 31.9%

Subtree of Another Tree

Asked at Meta
TreeDepth-First SearchString MatchingBinary TreeHash Function
#13
Rank
#3269MediumFrequency: 27.8%

Number of Subarrays That Match a Pattern I

Asked at Uber
ArrayRolling HashString MatchingHash Function
#14
Rank
#711HardFrequency: 25.1%

Number of Distinct Islands II

Asked at Amazon
ArrayHash TableDepth-First SearchBreadth-First SearchUnion-FindSortingMatrixHash Function
#15
Rank
#1060MediumFrequency: 23.6%

Longest Repeating Substring

Asked at Amazon
StringBinary SearchDynamic ProgrammingRolling HashSuffix ArrayHash FunctionSuffix AutomatonSuffix Tree
#16
Rank
#2051HardFrequency: 23.6%

Longest Common Subpath

Asked at Amazon
ArrayBinary SearchRolling HashSuffix ArrayHash FunctionSuffix AutomatonSuffix Tree
#17
Rank
#1557MediumFrequency: 23.3%

Check If a String Contains All Binary Codes of Size K

Asked at Google
Hash TableStringBit ManipulationRolling HashHash FunctionDirected Acyclic Graph
#18
Rank
#3603HardFrequency: 23.3%

Check if DFS Strings Are Palindromes

Asked at Google
ArrayHash TableStringTreeDepth-First SearchHash Function
#19
Rank
#1508HardFrequency: 22%

Longest Happy Prefix

Asked at Apple
StringRolling HashString MatchingHash FunctionZ AlgorithmKnuth–Morris–Pratt Algorithm
#20
Rank
#3305HardFrequency: 20.3%

Count Prefix and Suffix Pairs II

Asked at Uber
ArrayStringTrieRolling HashString MatchingHash FunctionZ Algorithm
#21
Rank
#1838MediumFrequency: 20.3%

Number of Distinct Substrings in a String

Asked at Uber
StringTrieRolling HashSuffix ArrayHash Function
#22
Rank
#2326HardFrequency: 20%

Sum of Scores of Built Strings

Asked at Amazon
StringBinary SearchRolling HashSuffix ArrayString MatchingHash FunctionZ AlgorithmKnuth–Morris–Pratt Algorithm
#23
Rank
#3303HardFrequency: 19.5%

Find Beautiful Indices in the Given Array II

Asked at Google
Two PointersStringBinary SearchRolling HashString MatchingHash FunctionZ AlgorithmKnuth–Morris–Pratt AlgorithmBoyer–Moore String-Search Algorithm
#24
Rank
#3821MediumFrequency: 19.5%

Count Cells in Overlapping Horizontal and Vertical Substrings

Asked at Google
ArrayStringRolling HashString MatchingMatrixHash Function
#25
Rank
#1244HardFrequency: 18%

Distinct Echo Substrings

Asked at Google
StringTrieRolling HashSuffix ArrayHash FunctionSuffix AutomatonSuffix Tree
#26
Rank
#1251HardFrequency: 18%

Longest Chunked Palindrome Decomposition

Asked at Google
Two PointersStringDynamic ProgrammingGreedyRolling HashHash Function
#27
Rank
#718MediumFrequency: 18%

Maximum Length of Repeated Subarray

Asked at Google
ArrayBinary SearchDynamic ProgrammingSliding WindowRolling HashHash Function
#28
Rank
#816EasyFrequency: 18%

Design HashSet

Asked at Google
ArrayHash TableLinked ListDesignHash Function
#29
Rank
#2079HardFrequency: 8.1%

Delete Duplicate Folders in System

Asked at Google
ArrayHash TableStringDepth-First SearchTrieSortingHash Function
#30
Rank
#3245MediumFrequency: 7.3%

Find Beautiful Indices in the Given Array I

Asked at Microsoft
Two PointersStringBinary SearchRolling HashString MatchingHash FunctionZ AlgorithmKnuth–Morris–Pratt AlgorithmBoyer–Moore String-Search Algorithm
#31
Rank
#3309EasyFrequency: 5%

Count Prefix and Suffix Pairs I

Asked at Google
ArrayStringTrieRolling HashString MatchingHash Function
#32
Rank
#2275HardFrequency: 5%

Find Substring With Given Hash Value

Asked at Google
StringSliding WindowRolling HashHash Function
#33
Rank
View All Topics

Master Hash Function in Real Interviews

Get AI-powered assistance when solving hash function problems during your actual interviews.

Get Started Free

No credit card required

Interview Solver
  • Home
  • About
  • Pricing
  • Sign in
  • Contact
  • Blog
  • Companion
  • Mobile
  • Help Center
  • Developers
  • Use Cases
  • Software Engineer
  • Product Manager
  • Misc
  • Privacy Policy
  • Terms and Conditions
  • Refund & Cancellation
  • Discord Community
  • Affiliate Program
  • Compare
  • All Comparisons
  • vs Final Round AI
  • vs UltraCode
  • vs Interview Coder
  • vs LockedIn AI
  • vs AI Apply
  • Free Tools
  • ATS Resume Checker
  • STAR Method Builder
  • Salary Lookup
  • Big O Cheat Sheet
  • Total Comp Calculator
  • View All →
  • Interview Questions
  • Google Questions
  • Amazon Questions
  • Microsoft Questions
  • Meta Questions
  • Apple Questions
  • TikTok Questions
  • View All →
© 2026 Interview Solver, Inc. All rights reserved.