Integral Ad Science interview question

Write code to solve <common algorithmic problem>. Can we do this more efficiently? What are the tradeoffs?