Object-Oriented Programming · Snowflake · Medium
Event Recorder Medium · Topics · Company Tags · Hints Design a system that logs timestamped events and supports querying how many events occurred inside a given time window. Implement the EventRecorder class: EventRecorder() — initializes an empty recorder. void record(int timestamp) — logs one event at the provided timestamp (in seconds). Callers may invoke record with timestamps that are not monotonically increasing. int[] query(int start, int end, int granularity) —…
Checking your access…