Back to problems

Tally Service

Object-Oriented Programming · Meta · Medium

Time‑Windowed Event Tally Medium · Topics: Concurrency, Sliding Window, Data Structures Design a thread‑safe service that records timestamped events and answers queries about how many events occurred inside a given time interval. The public API is: void bump(long timestamp) — records one event at the provided timestamp. int query(long startTime, long endTime) — returns the number of recorded events whose timestamp falls in the inclusive range [startTime, endTime]. The…

Checking your access…