Pergunta de entrevista da empresa TiVo

Q. Find whether a given string consisting of parenthesis is a valid parenthesis block or not?