Maintain real-time top-K products from events | Amazon Coding Question