Some solutions for programming interview questions