Rakuten Kobo interview question

Coding in Java