Question d’entretien chez Google Cloud

How to code this in Java?