Bunch of interview questions solved in Java