Complex Java Interview Coding Practice