Pregunta de entrevista de Booking.com

Implement random function as it's implemented in Java