Alpaca interview question

Implement select group by in a big dataset