1. Given a String composed by ( or ) and [ and ]. Need to tell whether it is valid.
(()) is valid.
([]{} is invalid.

Follow up, make your function more generic. There is one more parameter, called pair string, such as "()[]{}".
My solution is to scan the pair string to record the correlated characters. If the pair is K length, and the value is N. Then the time complexicity is O(k+n)

2. Give a music library, design a random function. Require if there are songs not being played, the the random function should only play one of it.