Booking.com interview question

implement something like graphite