Amazon interview question

1. Implement a queue using stack 2. Generate valid parentheses