Interview Coding Problems Java