# Balance Parentheses with Minimum Removals

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/4214/balance-parentheses-minimum-removals
Source observed: 2026-11-04T22:03:13.840Z
Last checked: 2026-11-04T22:03:13.84+00:00
Indexed: 2026-11-05T08:48:04.973+00:00

---

# Balance Parentheses with Minimum Removals

We provide interview-practice questions for technical roles. This Data Structures & Algorithms and Coding question asks you to write a function that removes the fewest characters from a given string so that every opening parenthesis has a corresponding closing parenthesis and all pairs are properly nested.

## Question details

- **Reported interviews:** 2
- **Reported last asked:** 2 years ago
- **Roles:** [Machine Learning Engineer](https://www.aced.io/questions?role=ml-engineer), [Software Engineer](https://www.aced.io/questions?role=swe)
- **Company:** [Meta](https://www.aced.io/questions?company=meta-facebook) — 2
- **Categories:** [Data Structures & Algorithms](https://www.aced.io/questions?type=algorithms), [Coding](https://www.aced.io/questions?type=coding)

The page includes controls to mark that you were asked this question and to save it. Submitting an answer marks the question complete.

## Community answers

No answers have been contributed by the community yet.

## Related question

[Given a string with parentheses, write a function that removes the minimum number of characters to balance the parentheses.](https://www.aced.io/questions/4537/balance-parentheses-string-manipulation)

## Related courses

### [Machine Learning Engineer Interview Prep](https://www.aced.io/courses/ml-engineer)

![Machine Learning Engineer Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/6UfkHxUyLQVfDHSfLNQtWa/1be1539a65b4f6f15201f5b573c0a578/ML_Engineer_Interview_Prep_Course.jpeg?w=800&h=800&fm=webp&q=75)

We help you prepare for machine learning roles at Meta, Google, Amazon, Apple, Microsoft, Nvidia, and other companies through mock interviews, frameworks, and advice from senior candidates. The course covers ML system design, core concepts, coding, behavioral interviews, and more.

### [Software Engineering Interview Prep](https://www.aced.io/courses/software-engineering)

![Software Engineering Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/4VkuYewBHUFIVUS5oJDW5h/02e833439b1289f25f38f13f81cbdca3/adobe_stock_optimized.jpeg?w=800&h=800&fm=webp&q=75)

We help you prepare for software engineering roles at Google, Amazon, Microsoft, Meta, Apple, and other companies. Practice data structures, algorithms, system design, people management, and behavioral interviews with mock interviews, frameworks, and advice from senior candidates.

## Answer submission

Use the answer area to submit your response. Submitting marks this question complete.

[Browse all questions](https://www.aced.io/questions) · [Upgrade](https://www.aced.io/upgrade?src=questions)

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F4214%2Fbalance-parentheses-minimum-removals&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F4214%2Fbalance-parentheses-minimum-removals). Opening a form does not execute a tool.