Booking.com Interview Question

implement something like graphite