FastPrepWildcard Matching with Stars
Problems/Wildcard Matching with Stars

Wildcard Matching with Stars

Confluent logoConfluent● MediumNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The firsthand Confluent reports name wildcard matching, forbid the DP shortcut in one round, and clarify the follow-up from one star to many stars. Our version supports only the star wildcard from the reports. It is about 90% the same as the reported questions.

You are given a lowercase string text and a pattern pattern containing lowercase letters and the wildcard *.

A letter matches the same letter. A * matches any sequence of characters, including the empty sequence. Return true if the entire pattern matches the entire text; otherwise return false.

Consecutive stars have the same meaning as a single star.

Function

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

Examples

Example 1

text = "adceb"pattern = "*a*b"return = true

The first star can match the empty prefix and the second star can match dce.

Example 2

text = "acdcb"pattern = "a*c*d"return = false

The pattern requires a final d, but the text ends with b; no star expansion can change that literal mismatch.

Example 3

text = "abc"pattern = "***"return = true

Consecutive stars collectively match the entire text.

Constraints

  • 0 <= text.length <= 200000.
  • 1 <= pattern.length <= 200000.
  • text contains lowercase English letters.
  • pattern contains lowercase English letters and *.

More Confluent Phone Screen questions

  • Implement tail -nPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Sudoku Board ValidationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Sudoku Puzzle SolverPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Match a Variadic Function SignaturePHONE SCREEN · Seen Oct 2026
  • Sequential Phrase Search Across DocumentsPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Time Map with Sum and AveragePHONE SCREEN · Seen Sep 2026
  • Time-Based Key-Value Store with Range AggregatesPHONE SCREEN · Seen Sep 2026
  • Word Search Across DocumentsPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Windowed Key-Value MapPHONE SCREEN · ONSITE INTERVIEW · Seen Jul 2025
  • Least-Strong Common DefeaterPHONE SCREEN · Seen Oct 2022

Similar questions at other companies

  • Shortest Way to Form a Target StringPinterest · PHONE SCREENPinterest interview questions
  • Text Pattern Matching with StarsHeadlands Technologies · PHONE SCREENHeadlands Technologies interview questions
  • Palindrome After At Most One DeletionAdobe · PHONE SCREENAdobe interview questions
  • Minimum Swaps to Make PalindromeAmazon · OA
  • Smallest Merge of Two StringsCapital One · OACapital One interview questions
  • Longest Spoken PrefixElevenLabs · ONSITE INTERVIEWElevenLabs interview questions
  • Missing WordsVanguard · OAVanguard interview questions
  • Longest Palindromic SubstringSiemens · PHONE SCREEN
  • Reverse Words in a StringAgoda · PHONE SCREENAgoda interview questions
  • Longest Palindromic SubstringIBM · PHONE SCREENIBM interview questions

Interview reports that mention this question

  • Confluent Coding and System Design Questions: 33 Questions

Confluent interview experiences

  • Confluent Older Concurrency Rounds: 12 Experiences (Part 2 of 2)
  • Confluent Concurrency Interviews: 28 Experiences (Part 1 of 2)
  • Confluent SWE OA, Coding and Design Interviews: 19 Experiences
  • Confluent File Manipulation Round (tail -n): 19 Experiences
All Confluent interview questionsSee Confluent hiring insights
Saved
class Solution {
    public boolean matchesPattern(String text, String pattern) {
        // Write your code here.
    }
}
Checking account…