Booking.com Interview Question

Develop algorithms and talk about its efficiency using Big O notation.