FastPrepWildcard Multi-Delimiter Validation
Problems/Wildcard Multi-Delimiter Validation

Wildcard Multi-Delimiter Validation

Tennr logoTennr● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A firsthand Tennr second-round DSA report is based on Valid Parenthesis String. It also adds angle brackets and paired bars. The report does not say how the wildcard works for the extra delimiters. Here, the wildcard still works only for parentheses. We also set a fixed nesting rule for <> and ||.

Given a string s containing (, ), <, >, |, and *, return whether it can form a valid, properly nested delimiter string.

The matching pairs are (), <>, and ||. Each * may independently be (, ), or the empty string. A single | can serve as the opening or closing bar according to its matching partner.

Function

isValidDelimiters(s: String) → boolean

Examples

Example 1

s = "<(*)>"return = true

Use the wildcard as the empty string; the remaining delimiters are nested.

Example 2

s = "<|*)|>"return = true

Use the wildcard as an opening parenthesis, producing <|()|>.

Example 3

s = "<(|>)"return = false

The delimiters cross instead of nesting.

Constraints

  • 0 <= s.length <= 80.
  • s contains only (, ), <, >, |, and *.

More Tennr Phone Screen questions

  • Top K Frequent ElementsPHONE SCREEN · Seen Aug 2025
  • Find First and Last Position in Sorted ArrayPHONE SCREEN · Seen Feb 2025

Similar questions at other companies

  • Longest Palindromic SubstringSiemens · PHONE SCREEN
  • Query Words Within K PositionsPalantir · PHONE SCREENPalantir interview questions
  • Edit DistanceDP World · PHONE SCREEN
  • Longest Palindromic SubstringIBM · PHONE SCREENIBM interview questions
  • Word BreakAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Decode WaysThe D.E. Shaw Group · PHONE SCREENThe D.E. Shaw Group interview questions
  • Edit DistanceAstrotalk · PHONE SCREEN
  • Longest Palindromic SubstringeBay · PHONE SCREENeBay interview questions
  • Validate a Palindrome After Limited DeletionsMeta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions
  • Count Palindromic SubstringsThe Voleon Group · PHONE SCREEN
See Tennr hiring insights
Saved
class Solution {
    public boolean isValidDelimiters(String s) {
        // Write your code here.
    }
}
Checking account…