Skip to content

Interview Solver

FeaturesPricingHelp
Sign In
FeaturesPricingHelpSign In
Interview Questions›Topics›String Matching

String Matching Interview Questions

Master 29 string matching problems frequently asked in technical interviews. These questions test your understanding of string matchingconcepts and are essential for coding interview success.

29
Total Problems
10
Easy
9
Medium
10
Hard

Related Topics

StringArrayHash FunctionRolling HashKnuth–Morris–Pratt AlgorithmZ AlgorithmTwo PointersTrie
#3770HardFrequency: 59.3%

Lexicographically Smallest Generated String

Asked at TikTok
StringGreedyString Matching
#1
Rank
#28EasyFrequency: 55.2%

Find the Index of the First Occurrence in a String

Asked at Microsoft
Two PointersStringString MatchingZ AlgorithmKnuth–Morris–Pratt AlgorithmBoyer–Moore String-Search Algorithm
#2
Rank
#812EasyFrequency: 48.1%

Rotate String

Asked at Amazon
StringString Matching
#3
Rank
#3333MediumFrequency: 47.5%

Find Pattern in Infinite Stream I

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

Find Pattern in Infinite Stream II

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

Shortest Palindrome

Asked at Google
StringRolling HashString MatchingHash FunctionManacherZ AlgorithmKnuth–Morris–Pratt Algorithm
#6
Rank
#459EasyFrequency: 34.8%

Repeated Substring Pattern

Asked at Google
StringString MatchingZ AlgorithmKnuth–Morris–Pratt Algorithm
#7
Rank
#616MediumFrequency: 33%

Add Bold Tag in String

Asked at TikTok
ArrayHash TableStringTrieString MatchingAho–Corasick Algorithm
#8
Rank
#572EasyFrequency: 31.9%

Subtree of Another Tree

Asked at Meta
TreeDepth-First SearchString MatchingBinary TreeHash Function
#9
Rank
#686MediumFrequency: 29.7%

Repeated String Match

Asked at Google
StringString MatchingZ AlgorithmKnuth–Morris–Pratt AlgorithmBoyer–Moore String-Search Algorithm
#10
Rank
#3269MediumFrequency: 27.8%

Number of Subarrays That Match a Pattern I

Asked at Uber
ArrayRolling HashString MatchingHash Function
#11
Rank
#3684EasyFrequency: 26.5%

Substring Matching Pattern

Asked at Amazon
StringString Matching
#12
Rank
#2292EasyFrequency: 24.4%

Counting Words With a Given Prefix

Asked at Google
ArrayStringString Matching
#13
Rank
#3692HardFrequency: 23.6%

Shortest Matching Substring

Asked at Amazon
Two PointersStringBinary SearchString Matching
#14
Rank
#1508HardFrequency: 22%

Longest Happy Prefix

Asked at Apple
StringRolling HashString MatchingHash FunctionZ AlgorithmKnuth–Morris–Pratt Algorithm
#15
Rank
#1524EasyFrequency: 21.9%

String Matching in an Array

Asked at Amazon
ArrayStringString Matching
#16
Rank
#1874MediumFrequency: 21.9%

Form Array by Concatenating Subarrays of Another Array

Asked at Amazon
ArrayTwo PointersGreedyString MatchingKnuth–Morris–Pratt Algorithm
#17
Rank
#3305HardFrequency: 20.3%

Count Prefix and Suffix Pairs II

Asked at Uber
ArrayStringTrieRolling HashString MatchingHash FunctionZ Algorithm
#18
Rank
#2326HardFrequency: 20%

Sum of Scores of Built Strings

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

String Transformation

Asked at Google
MathStringDynamic ProgrammingString Matching
#20
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
#21
Rank
#3821MediumFrequency: 19.5%

Count Cells in Overlapping Horizontal and Vertical Substrings

Asked at Google
ArrayStringRolling HashString MatchingMatrixHash Function
#22
Rank
#760MediumFrequency: 16.4%

Bold Words in String

Asked at Google
ArrayHash TableStringTrieString MatchingAho–Corasick Algorithm
#23
Rank
#1080MediumFrequency: 16.4%

Camelcase Matching

Asked at Google
ArrayTwo PointersStringTrieString Matching
#24
Rank
#3580HardFrequency: 10.5%

Find the Occurrence of First Almost Equal Substring

Asked at Google
StringString MatchingKnuth–Morris–Pratt Algorithm
#25
Rank
#1764EasyFrequency: 8.1%

Maximum Repeating Substring

Asked at Google
StringDynamic ProgrammingString Matching
#26
Rank
#1566EasyFrequency: 7.3%

Check If a Word Occurs As a Prefix of Any Word in a Sentence

Asked at Microsoft
Two PointersStringString Matching
#27
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
#28
Rank
#3309EasyFrequency: 5%

Count Prefix and Suffix Pairs I

Asked at Google
ArrayStringTrieRolling HashString MatchingHash Function
#29
Rank
View All Topics

Master String Matching in Real Interviews

Get AI-powered assistance when solving string matching problems during your actual interviews.

Get Started Free

No credit card required

Interview Solver
  • Home
  • About
  • Pricing
  • Sign in
  • Contact
  • Blog
  • Companion
  • 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.