Booking.com Interview Question

Implement random function as it's implemented in Java