Pregunta de entrevista de Booking.com

system design, simple algorithm question