Reddit software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
System Design Questions - Reddit These are the most commonly asked system design questions from Reddit interviews.
Input: Number(s)add_api(api_name: str, quota: int) -> None: Adds a new API with its request quota.can_request(user_id: str, api_name: str) -> bool: Checks if the user can make a request to the given API.record_request(user_id: str, api_name: str) -> None: Records a request made by the user to the given API.reset_user_quota(user_id: str, api_name: str) -> None: Resets the user's quota after a designated time interval.add_api("getComments", 100) → Output: None → Explanation: A new API with a quota of 100 requests has been added.can_request("user123", "getComments") → Output: True → Explanation: User can make a request as they haven't exceeded the quota.record_request("user123", "getComments") → Output: None → Explanation: Request recorded.can_request("user123", "getComments") → Output: True/False → Explanation: Depending on the number of recorded requests.RateLimiter class should handle different quotas for each user per API efficiently.def set_limit(user_id: str, api_name: str, limit: int, period: int) -> None: Sets the rate limit for a particular user on a specific API. def can_request(user_id: str, api_name: str) -> bool: Checks if a user can request an API call without exceeding the limit. def record_request(user_id: str, api_name: str) -> None: Records an API request for a user. def reset_usage(user_id: str, api_name: str) -> None: Resets the usage for a user on a specific API after the defined period.set_limit('user123', 'api1', 5, 60) record_request('user123', 'api1') can_request('user123', 'api1') True set_limit('user123', 'api1', 2, 30) record_request('user123', 'api1') record_request('user123', 'api1') can_request('user123', 'api1') False Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free