Integral Ad Science Interview Question

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