Unthinkable interview question

Write code for checking valid parenthesis.