It's a clever intervew if you expect the answer to be "I would find an appropriate module on cpan".
People shouldn't be rewriting these algorithms.
People shouldn't be rewriting these algorithms.
So many security and performance problems I've run into boil down to people not bothering to use a good standard library or framework for solving a problem.
Or, at a more fundamental level, people who can't be fucked learning SQL properly so haul heaps of data into the application and try to beat Oracle at implementing joins and GROUP BY[1].
[1] If you can beat Oracle at that, you are wasting your time working with me. Larry, IBM, or Microsoft will give you swimming pools of money to come make their databases better.