Algorithm · Bloomberg · Medium
Requirements Create a class that processes request events. Every event contains a timestamp and a user ID: A user is considered active when they have appeared at least once during the preceding five-minute interval. Before implementing the class, establish whether an event exactly at currentTimestamp - 300 belongs to the interval; the boundary at five minutes is an explicit part of the discussion. Assume the following: Event timestamps are supplied in nondecreasing order.…
Checking your access…