Design a system to process a stream of events. In the base version, implement two functions: (1) Receive(event_type, timestamp) — ingests an event of a given type at a given timestamp; timestamps are guaranteed to be non-decreasing. (2) Count(event_type, start_time, end_time) — returns the count of events of the given…