Tripadvisor interview question

We pair program a simple algorithm using a classical data structure. We discussed time complexity as well.