PayPal SWE Interview Question 2024 June | Backtracking | on-campus
PayPal · Question · Posted Jun 2026
Question 1: Generate Parentheses Problem Statement Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Constraints 1 <= n <= 8 Examples Example 1: Input: n = 3 Output: ["((()))","(()())","(())()","()(())","()()()"] Explanation 1: There are 5 unique valid configurations of 3 pairs of parentheses. Every opening parenthesis must be closed in a mathematically valid nested structure. Example 2: Input: n = 1 Output: ["()"] Explanation 2: With 1 pair of parentheses, the only valid configuration ...
The full answer & interview discussion are available to premium members.
Log in Create a free account