Generalist Interview Questions

6,657 generalist interview questions shared by candidates

Your program should perform parentheses matching on a given string to verify that the parentheses are balanced. It should print "True" if the match is good and "False" if the match is bad. The input will be a string with 3 different kinds of parentheses - { }, [ ], ( ) Examples: Valid: (returns True) abc{def}ghi(jkl)mno[pqr] a{([b])} Invalid: (returns False) abc{(def}) ab[c) abc}def{ Bonus Points for solutions that do not use extra memory (ex. mutable variables) to store state.
avatar

R&D Engineer (Generalist)

Interviewed at DreamWorks Animation

4.3
Apr 17, 2014

Your program should perform parentheses matching on a given string to verify that the parentheses are balanced. It should print "True" if the match is good and "False" if the match is bad. The input will be a string with 3 different kinds of parentheses - { }, [ ], ( ) Examples: Valid: (returns True) abc{def}ghi(jkl)mno[pqr] a{([b])} Invalid: (returns False) abc{(def}) ab[c) abc}def{ Bonus Points for solutions that do not use extra memory (ex. mutable variables) to store state.

Viewing 1081 - 1090 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 6,657 interview questions and reports from Generalist interviews. Prepare for your interview. Get hired. Love your job.