As reported: Workday Senior Software Engineer round 1 with the hiring manager (2025), coded on HackerRank: validate a string of parentheses. Follow-up: if the input is huge and the heap fills up / memory overflows, how would you solve it?
Given a string s of ()[]{}, return true if every opener is closed by the same type in the correct order.
This is LeetCode 20 — Valid Parentheses.
Example
"()[]{}" -> true
"([)]" -> false
"{[]}" -> true
Follow-ups
- The input is so large that holding it (or the stack) in memory overflows the heap. How do you validate it?
Constraints: 1 ≤ s.length ≤ 10^4 for the runner.
Code runner format: one line with s as a JSON string. Implement isValid(s); the harness prints true or false. The runner checks the main question.