MongoDB
4.3 of 5 43 reviews
www.mongodb.com New York, NY 150 to 499 Employees

MongoDB Software Engineering Intern Interview Question

"Given a set of open and close parenthesis, make sure the string is valid, such that each open parenthesis has a matching close parenthesis in the correct place."
Add Tags [?]
Answer Flag Question

Part of a Software Engineering Intern Interview Review - one of 26 MongoDB Interview Reviews

Answers & Comments

0
of 0
votes
Use a stack - push on an open bracket, pop on a close bracket, and if a pop fails (due to an empty stack) then the string is invalid.
- int on Oct 7, 2013 Flag Response

To comment on this question, Sign In with Facebook or Sign Up


Tags are like keywords that help categorize interview questions that have something in common.

Glassdoor is your free inside look at MongoDB interview questions and advice. All interview reviews posted anonymously by MongoDB employees and interview candidates.