Object-Oriented Programming · C3.ai · Medium
Events arrive continuously as a stream of strings. Build a component that ingests each event as it arrives and, whenever asked, returns the K events that have occurred most often up to that point. Follow-ups Be prepared to discuss the trade-offs between keeping exact counts and using approximate counting, in terms of memory usage, the cost of each update, and the cost of each top-K query.