FastPrepDoes Any Pattern Part Occur?
Problems/Does Any Pattern Part Occur?

Does Any Pattern Part Occur?

Intuit logoIntuit● EasyFULLTIMEOA

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The reports say that a part of a pattern must occur, without a minimum length. This practice version permits length-one parts and uses case-sensitive ASCII; about 80% match.

Return whether text contains any nonempty contiguous substring of pattern. A part may have length one. Matching is case-sensitive. If either string is empty, return false.

Function

hasPatternPart(text: String, pattern: String) → boolean

Examples

Example 1

text = "cab"pattern = "xyzab"return = true

The single-character part a occurs in text.

Example 2

text = "abc"pattern = "XYZ"return = false

No character is shared.

Constraints

  • For this exercise, assume ASCII strings of length at most 200000.

More Intuit Online Assessment questions

  • Employee Promotion OpportunitiesOA · Seen Oct 2026
  • Next Pascal Row CoefficientOA · Seen Oct 2026
  • Parse Router LogsOA · Seen Oct 2026
  • Longest Repeated Letter Block with Adjacent SwapsOA · Seen Oct 2026
  • Maximum Square-Free DivisorOA · Seen Oct 2026
  • Two Tribes from Taller-Person CountsOA · Seen Oct 2026
  • Shortest Path from an Encoded GraphOA · Seen Sep 2026
  • Oldest and Youngest EmployeesOA · Seen Sep 2026
  • Pressure-Isolation Shutdown OrderOA · Seen Sep 2026
  • Submask Sum QueriesOA · Seen Sep 2026

Similar questions at other companies

  • Count User Mentions in Chat MessagesRamp · OARamp interview questions
  • First Non-Repeating CharacterAmazon · OA · ONSITE INTERVIEW
  • Total Each Letter's Count in an Encoded StringIBM · OAIBM interview questions
  • Find Words That Can Be Formed by CharactersTabaPay · OA
  • Blood Type Inheritance: Possible Parent GenotypesAbridge · OAAbridge interview questions
  • Count Palindrome Addition ChoicesThe D.E. Shaw Group · OAThe D.E. Shaw Group interview questions
  • Count Palindrome Addition ChoicesHudson River Trading · OAHudson River Trading interview questions
  • Count Phrases Formed by Anagram ReplacementWells Fargo · OAWells Fargo interview questions
  • Count Repeated Request IDs (Data Science OA)McKinsey & Company · OAMcKinsey & Company interview questions
  • Branch with the Most FilesCapital One · OACapital One interview questions

Interview reports that mention this question

  • Intuit OA: What It Tests (2026)

Intuit interview experiences

  • Intuit Software Engineering Intern - Full Stack OA Format
All Intuit interview questionsSee Intuit hiring insights
Saved
class Solution {
    public boolean hasPatternPart(String text, String pattern) {
        // Write your code here
    }
}
Checking account…