Booking.com interview question

Implement random function as it's implemented in Java