Uber DevOps engineer interviews cover CI/CD pipelines, infrastructure as code, container orchestration, monitoring, and incident response procedures.
RateLimiter that manages request limits for different API keys. is_allowed(api_key: str) -> bool: Returns whether a new request is allowed for the given API key.on_request(api_key: str) -> None: Registers a new request for the given API key.set_limit(api_key: str, limit: int, period: int) -> None: Sets the rate limit and time period for the specified API key.Example 1:set_limit('user_api', 5, 60)Noneuser_api.Example 2:is_allowed('user_api')Trueuser_api is allowed.Constraints:1 <= api_key.length <= 100Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free