Solutions to InterviewStreet problems in Java