Code interview questions, examples in Java