PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Meta

Remove minimum invalid mixed brackets

Last updated: Mar 29, 2026

Quick Overview

This Coding & Algorithms problem evaluates string-processing and bracket-matching skills, specifically understanding of stack-based parsing, handling multiple bracket types, and minimizing removals while preserving non-bracket characters.

  • hard
  • Meta
  • Coding & Algorithms
  • Software Engineer

Remove minimum invalid mixed brackets

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Technical Screen

Given a string `s` containing letters and bracket characters from the set `()`, `[]`, `{}`, remove the minimum number of bracket characters so that the resulting string has properly matched and properly nested brackets. Rules: - Matching must respect types: `(` matches `)`, `[` matches `]`, `{` matches `}`. - Brackets must be properly nested (e.g., `([)]` is invalid). - Keep all non-bracket characters in their original order. - If multiple valid answers exist, return any one. Example: - Input: `([{ab)` - Output: `(ab)` (remove `[` and `{` to make the remaining brackets valid).

Quick Answer: This Coding & Algorithms problem evaluates string-processing and bracket-matching skills, specifically understanding of stack-based parsing, handling multiple bracket types, and minimizing removals while preserving non-bracket characters.

Related Interview Questions

  • Solve Two Backtracking Array Problems - Meta (hard)
  • Solve Array, Matrix, and Recommendation Problems - Meta (medium)
  • Find a String Containing Another - Meta (medium)
  • Solve Subarray Sum and Local Minimum - Meta (hard)
  • Validate abbreviations and brackets - Meta (medium)
Meta logo
Meta
Feb 17, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
3
0

Given a string s containing letters and bracket characters from the set (), [], {}, remove the minimum number of bracket characters so that the resulting string has properly matched and properly nested brackets.

Rules:

  • Matching must respect types: ( matches ) , [ matches ] , { matches } .
  • Brackets must be properly nested (e.g., ([)] is invalid).
  • Keep all non-bracket characters in their original order.
  • If multiple valid answers exist, return any one.

Example:

  • Input: ([{ab)
  • Output: (ab) (remove [ and { to make the remaining brackets valid).

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Meta•More Software Engineer•Meta Software Engineer•Meta Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.