Reported interview periodNov 2025–Aug 2026
Rolling Request Load and QPS
Build a counter that records requests by timestamp and reports request load or queries per second over a trailing window.
Practice focusRequirements - Timestamps are non-negative non-boolean integer seconds and arrive in non-decreasing order. Reject invalid or decreasing timestamps with ValueError before changing state. - Multiple requests may have the same timestamp. - Current time is the latest timestamp observed. - A window of seconds includes events satisfying now - seconds < t <= now . - Both queries require a positive non-boolean integer seconds , otherwise raise ValueError . get qps is load divided by seconds . Before any hits, both return zero.…