Question
Build a counter that records requests by timestamp and reports request load or queries per second over a trailing window.
```python
class HitCounter:
def hit(self, timestamp: int) -> None: ...
def get_load(self, seconds: int) -> int: ...
def get_qps(self, seconds: int) -> float: ...
```
## Requirements
- 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. Queries do not advance time or alter state.
- Aggregate requests sharing a second instead of retaining one record per request. The base interface has no maximum query window, so retain distinct-second history needed for arbitrary window queries; bounded retention requires an explicit maximum-window extension, not silent data eviction.
- The constructor takes no arguments. The supplied `run_case` dispatches fixtures; implement the class methods rather than this driver.
For hits at `1, 2, 2, 3, 150, 301`, the load over 300 seconds is `5`, while the load over 200 seconds is `2`.
## Design discussion (not graded)
1. Add a key dimension for a key-value service and query per-key and global load.
2. Handle out-of-order events and define watermark or lateness semantics.
3. Distribute the counter across servers while bounding error.
4. Support arbitrary historical query times.
5. Add an explicit maximum query window and evict expired buckets; reject wider queries rather than returning an incomplete count.