MEDIUMasked at 1 company

Evaluate the Bracket Pairs of a String

A medium-tier problem at 68% community acceptance, tagged with Array, Hash Table, String. Reported in interviews at Remitly and 0 others.

Founder's read

You're given a string where bracket pairs are nested and indexed, and you need to evaluate it correctly. This isn't a simple bracket-matching problem. Remitly has asked it, and the acceptance rate sits around 68%, which means most people get it wrong the first time. The trap is assuming you can solve it with a single pass or a straightforward stack. The real issue is understanding how the indexing works when brackets reference each other, then building the right data structure to track those relationships without getting lost in the nesting. If you hit this during an OA and the trick doesn't click, StealthCoder surfaces a working solution in seconds, invisible to the proctor.

Companies asking
1
Difficulty
MEDIUM
Acceptance
68%

Companies that ask "Evaluate the Bracket Pairs of a String"

If this hits your live OA

Evaluate the Bracket Pairs of a String is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too.

Get StealthCoder
What this means

The key insight is that you're not just matching brackets. You're evaluating a string where bracket pairs have indices, and inner pairs can reference outer ones. Most candidates start with a naive stack approach and hit a wall when they realize the evaluation logic isn't straightforward. You need to map each opening bracket to its closing bracket (and vice versa), then reconstruct the evaluated string by following the index references correctly. The common failure point is losing track of which substring you're currently evaluating when brackets point back to earlier positions. Hash tables are essential here to store the bracket pairings, and arrays help you rebuild the result. The pattern involves multiple passes: first to pair brackets, then to evaluate by jumping through the references. When you're live and the recursion or iteration logic tangles, StealthCoder eliminates the debugging overhead and hands you the correct structure immediately.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Evaluate the Bracket Pairs of a String recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Evaluate the Bracket Pairs of a String interview FAQ

Is this problem really a medium, or does it feel harder?+

The 68% acceptance rate suggests it's correctly rated. The difficulty is not in the complexity of the algorithm, but in understanding what the problem is actually asking you to do. Once you see the pattern, the implementation is straightforward. Most people waste time on incorrect interpretations.

Do I need to know special bracket evaluation tricks?+

No special tricks. You need hash tables to map bracket pairs and basic string manipulation. The hard part is the logic of traversing through the indexed references correctly. Understanding the problem statement is 70% of the work.

How does this relate to String and Array topics?+

You're manipulating a string character by character, building an array or string as output, and using hash tables to store bracket relationships. It combines all three topics, which is why it tests your ability to choose the right data structure for the job.

Will I see this at Remitly or similar companies again?+

Remitly is the only company in the dataset asking this problem. It's not a common pattern at other major tech companies, which makes it either a niche technical ask for that team or something they use to filter for careful problem-solvers.

What's the most common mistake?+

Misunderstanding the indexing or reference logic and trying to solve it with a single pass. Most people also skip mapping brackets upfront and regret it later. Build the bracket map first, then think about evaluation.

Want the actual problem statement? View "Evaluate the Bracket Pairs of a String" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.