1. Top 6 Recently Asked Uber System Design Questions
Category: Graph system design problemThis collection covers the most frequently asked system design questions at Uber interviews.Input: Graph (nodes and edges) Output: Computed result
Want to practise this one?
Create a free account to open the full question and practise Uber questions with AI.
1. [OA] Rate Limiter Design — Create a rate limiter used in Uber's API gateways
Uber's API requires a rate limiting mechanism to prevent abuse and ensure fair use of resources. Design a class 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: Input: set_limit('user_api', 5, 60) Output: None Explanation: Sets a limit of 5 requests per 60 seconds for user_api.Example 2: Input: is_allowed('user_api') Output: True Explanation: Returns whether the next request for user_api is allowed.Constraints:
1 <= api_key.length <= 100
The rate limit values are positive integers.
Want to practise this one?
Create a free account to open the full question and practise Uber questions with AI.