FastPrepWildcard Character Array Match
Problems/Wildcard Character Array Match

Wildcard Character Array Match

Google logoGoogle● EasyNEW GRADONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report gives an array and a target string, says that empty array entries may be any letter, and asks whether the array can form the string. We fixed matching by position, one-character wildcards, lowercase input, and what happens with lengths. Our base version is about 84% the same as the reported question.

Given pattern and target, determine whether the pattern array can represent the target string.

Each pattern entry is either a one-character string that must match the target at the same index, or the empty string, which is a wildcard matching any one lowercase English letter. The lengths must be equal.

Function

matchesWildcardArray(pattern: String[], target: String) → boolean

Examples

Example 1

pattern = ["a","","c"]target = "abc"return = true

The empty middle entry matches b.

Example 2

pattern = ["a","b"]target = "ac"return = false

The literal b does not match target character c.

Example 3

pattern = []target = ""return = true

Two empty sequences match.

Constraints

  • 0 <= pattern.length,target.length <= 200000.
  • Each pattern entry is empty or one lowercase English letter.
  • target contains only lowercase English letters.

More Google Onsite Interview questions

  • Route Pattern MatcherPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Evaluate a Nested Math ExpressionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Distinct Subset SumsONSITE INTERVIEW · Seen Nov 2026
  • Playlist With No Same Artist in a RowONSITE INTERVIEW · Seen Nov 2026
  • Delete Nodes and Return Forest RootsONSITE INTERVIEW · Seen Nov 2026
  • Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • First and Last Target Position in a Mountain ArrayONSITE INTERVIEW · Seen Nov 2026
  • Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • 0/1 Knapsack with Weight and Volume LimitsONSITE INTERVIEW · Seen Nov 2026
  • Batched Subsequence Word MatchesONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Bounded Word Guess SolverAtlassian · ONSITE INTERVIEW
  • Retry with an Attempt LimitOracle · ONSITE INTERVIEW
  • Extract Error Log ContextFlexTrade · ONSITE INTERVIEW
  • BitFont - Render a Kerned PairStripe · ONSITE INTERVIEW
  • Print Vertical Asterisk BarsMicrosoft · ONSITE INTERVIEW
  • Add Two Numbers Given as Digit ArraysCapital One · ONSITE INTERVIEW
  • Query Log MatchDatadog · PHONE SCREEN · ONSITE INTERVIEW
  • Compress Editor Actions into Operational Transform OperationsReplit · OA · PHONE SCREEN · ONSITE INTERVIEW
  • Trace Events from Stable Whole-Stack StatesAnthropic · ONSITE INTERVIEW
  • Hex Dump FormatterWaymo · ONSITE INTERVIEW

Google interview experiences

  • Google interviews · November 2026
  • Google Software Engineer Onsite Questions: 10 Experiences
  • Google OA: What It Tests (2026)
  • Google L4 SWE Phone Screen: 1 Experience
  • Google ML Engineering Manager Onsite: 1 Experience
  • Google Experienced SWE First Round and Onsite: 1 Experience
See Google hiring insights
Saved
class Solution {
    public boolean matchesWildcardArray(String[] pattern, String target) {
        // Write your code here.
    }
}
Checking account…