Back to problems

Process real-time enter/exit events and actives

Algorithm · Amazon · Hard

You are observing a real-time event stream from a platform where users join and leave channels. Each record contains four fields: user_id (string), channel (string), event_type (either "enter" or "exit"), and ts (a UTC ISO-8601 timestamp). A single user may enter and leave the same channel many times. Events are not guaranteed to arrive in timestamp order, and any event can be delayed by up to $$5$$ minutes. Batched pandas aggregation. Given a full day of events, compute the…

Checking your access…