FastPrepConfigurable Valid Brackets
Problems/Configurable Valid Brackets

Configurable Valid Brackets

Maven Clinic logoMaven Clinic● MediumFULLTIMEPHONE SCREENONSITE INTERVIEW

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Maven Clinic phone-screen and onsite reports describe validating parentheses, then extending the stack solution to additional delimiter types such as angle brackets. The configurable practice version matches that progression about 93%; it exposes delimiter pairs and ignores ordinary text.

Each two-character string in pairs gives an opening and its matching closing character. Ignore text characters absent from all pairs. Return true when configured delimiters are correctly nested and completely closed.

Function

validConfiguredParentheses(text: String, pairs: String[]) → boolean

Examples

Example 1

text = "x<aAb>y"pairs = ["<>","aA","bB"]return = false

The closer b does not match the expected A.

Constraints

  • Every pair has length two.
  • Pair characters are globally distinct.
  • text.length <= 10^6.

More Maven Clinic interview questions

  • Minimum Appointment Cancellations with a Required BreakPHONE SCREEN · Seen Jun 2026
  • Shortest Currency Conversion with Three-Decimal RatePHONE SCREEN · Seen Mar 2026
  • Meeting Rooms IIPHONE SCREEN · Seen Aug 2025
  • Possible BipartitionPHONE SCREEN · Seen Aug 2024
  • Paginate Provider Listings with Per-Page DiversityONSITE INTERVIEW · Seen Apr 2026
  • Longest Valid ParenthesesONSITE INTERVIEW · Seen Aug 2025

Similar questions at other companies

  • Most Frequent Call Path From Function Trace LogsRoblox · PHONE SCREENRoblox interview questions
  • Number Words to Digits in Any LanguageMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Simplify a Formula with Known and Unknown VariablesBetter.com · PHONE SCREEN
  • Configurable Valid ParenthesesBloomberg LP · PHONE SCREENBloomberg LP interview questions
  • Number of AtomsAmazon · ONSITE INTERVIEW
  • Business Account KYC Verification — Parts 1–5Stripe · PHONE SCREENStripe interview questions
  • File System Shell CommandsHarvey · ONSITE INTERVIEWHarvey interview questions
  • Fuzzy Word Lookup With One Misspelled LetterMeta · PHONE SCREENMeta interview questions
  • Group Timestamps into Consecutive-Day IntervalsDuolingo · PHONE SCREENDuolingo interview questions
  • Shortest Uncommon SubstringAirbnb · ONSITE INTERVIEWAirbnb interview questions
All Maven Clinic interview questionsSee Maven Clinic hiring insights
Saved
class Solution {
    public boolean validConfiguredParentheses(String text, String[] pairs) {
      // Write your code here.
    }
}
Checking account…