NumPy allowed · plain Python earns 10 bonus points
Implement deterministic canary-rollout traffic routing -- the real mechanism behind gradually shifting production traffic to a new model version.
Implement canary_route(request_id, canary_pct). Hash request_id with hashlib.md5, take the first 4 bytes as a big-endian unsigned int, and compute bucket = (that_int % 10000) / 100.0 (a value in [0, 100)). Return 'canary' if bucket < canary_pct, else 'stable'.
canary_route(request_id: str, canary_pct: float) -> str