Google Interview Question

They asked me to solve the **"Generate All Possible Balanced Parentheses"** problem recursively. Given an integer **n**, I had to write a function to generate all possible valid combinations of **n** pairs of parentheses. The challenge was to implement it efficiently using recursion and backtracking while ensuring the parentheses remained balanced at all times. The interviewer wanted me to explain my thought process clearly and optimize unnecessary recursive calls.