Google asks this frequently (asked + times). Meta and Amazon also ask it as a warm-up problem. It's the canonical stack problem. The matching pattern extends to many real-world scenarios: validating HTML/XML tags, parsing expressions, checking balanced delimiters in code. Meta often asks a harder variant: "Minimum Remove to Make Valid Parentheses." If you know this problem well, that variation becomes straightforward.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/maang-interview-prep/stacks/valid-parentheses-why-this-problem
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███████████████████████████████████████████████████████████████████████████████████████████