FastPrepRemove Character-Class Matches
Problems/Remove Character-Class Matches

Remove Character-Class Matches

Intuit logoIntuit● EasyFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Intuit full-time online assessment. The candidate says the task was to remove regex matches from text in Bash, but does not give the pattern. This exercise uses a literal character class and a function that takes a string. Our version is about 55% the same as the reported question.

Remove from text every character that occurs in characters, preserving the remaining order. Treat characters as the members of a literal ASCII character class. Each member matches itself; punctuation such as -, ], ^, and \ has no special syntax. Matching is case-sensitive. Return the remaining text.

Function

removeMatches(text: String, characters: String) → String

Examples

Example 1

text = "banana"characters = "an"return = "b"

Every a and n is removed.

Example 2

text = "A-a-"characters = "-a"return = "A"

Matching is literal and case-sensitive.

Constraints

  • For this exercise, assume both inputs contain ASCII characters and have 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 String removeMatches(String text, String characters) {
        // Write your code here
    }
}
Checking account…