String Matching DSA Problems

36 string matching problems for coding interviews and campus placements, with hints and company tags. Below are all 36: 10 easy, 11 medium and 15 hard. Practise them free on InternHack and track what you have solved.

String Matching problems, easiest first

  1. Check If a Word Occurs As a Prefix of Any Word in a Sentence (Easy)
  2. Count Prefix and Suffix Pairs I (Easy)
  3. Counting Words With a Given Prefix (Easy)
  4. Find the Index of the First Occurrence in a String (Easy)
  5. Maximum Repeating Substring (Easy)
  6. Repeated Substring Pattern (Easy)
  7. Rotate String (Easy)
  8. String Matching in an Array (Easy)
  9. Substring Matching Pattern (Easy)
  10. Subtree of Another Tree (Easy)
  11. Add Bold Tag in String (Medium)
  12. Bold Words in String (Medium)
  13. Camelcase Matching (Medium)
  14. Count Cells in Overlapping Horizontal and Vertical Substrings (Medium)
  15. Find Beautiful Indices in the Given Array I (Medium)
  16. Find Pattern in Infinite Stream I (Medium)
  17. Form Array by Concatenating Subarrays of Another Array (Medium)
  18. Minimum Number of Valid Strings to Form Target I (Medium)
  19. Minimum Time to Revert Word to Initial State I (Medium)
  20. Number of Subarrays That Match a Pattern I (Medium)
  21. Repeated String Match (Medium)
  22. Count Prefix and Suffix Pairs II (Hard)
  23. Find All Good Strings (Hard)
  24. Find Beautiful Indices in the Given Array II (Hard)
  25. Find Pattern in Infinite Stream II (Hard)
  26. Find the Occurrence of First Almost Equal Substring (Hard)
  27. Lexicographically Smallest Generated String (Hard)
  28. Longest Happy Prefix (Hard)
  29. Match Substring After Replacement (Hard)
  30. Maximum Deletions on a String (Hard)
  31. Minimum Time to Revert Word to Initial State II (Hard)
  32. Number of Subarrays That Match a Pattern II (Hard)
  33. Shortest Matching Substring (Hard)
  34. Shortest Palindrome (Hard)
  35. String Transformation (Hard)
  36. Sum of Scores of Built Strings (Hard)

Companies that ask string matching problems

Before your interview

Most resumes are filtered by software before a recruiter reads them. Check your resume ATS score free, no signup needed.

Other DSA topics