PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/System Design/Roblox

Design sliding-window rate limiter with multi-keys

Last updated: May 10, 2026

Quick Overview

Design sliding-window rate limiter with multi-keys evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

  • hard
  • Roblox
  • System Design
  • Software Engineer

Design sliding-window rate limiter with multi-keys

Company: Roblox

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Technical Screen

Design and implement a precise sliding-window rate limiter for an API. Part A: Enforce a global cap of R requests within any rolling T-second window (true sliding window, not fixed window or token bucket). Specify the public interface, data structures, time resolution, and time/space complexity. Part B: Each request includes userId and userExperience fields. Enforce independent limits per userId and per userExperience concurrently (e.g., U requests per T seconds per userId and X requests per T seconds per userExperience). Explain key design choices: how to structure keys/counters to support multiple dimensions without double-counting; how to evict stale state efficiently; how to deploy and scale this in a distributed environment (sharding, coordination, clock skew, idempotency); and how you would test correctness and edge cases (bursts, boundary timestamps, window rollover).

Quick Answer: Design sliding-window rate limiter with multi-keys evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Related Interview Questions

  • Design a Played-By Summary System - Roblox (hard)
  • Design a Reusable Dropdown Menu Component - Roblox (medium)
  • Design Multi-Dimensional Request Rate Limiting - Roblox (easy)
  • Design a Scalable Likes System - Roblox (medium)
  • Design favorites and social game recommendations - Roblox (medium)
|Home/System Design/Roblox

Design sliding-window rate limiter with multi-keys

Roblox logo
Roblox
Jul 16, 2025, 12:00 AM
hardSoftware EngineerTechnical ScreenSystem Design
48
0

Design sliding-window rate limiter with multi-keys

Design a Precise Sliding-Window Rate Limiter

Context

You are designing a rate limiter for an API that must enforce a true sliding-window limit (i.e., at any instant, only the last T seconds of traffic count toward the quota). You will first design a global limiter, then extend it to multi-dimensional limits.

Part A — Global Limit

Design and implement a precise sliding-window rate limiter that enforces a cap of R requests within any rolling T-second window (true sliding window; not fixed window or token bucket). Specify:

  1. Public interface (inputs, return values, error semantics)
  2. Data structures and state storage (single-host and distributed options)
  3. Time source and resolution
  4. Time and space complexity per request

Part B — Per-Dimension Limits

Each request includes two attributes: userId and userExperience.

Enforce all of the following limits concurrently:

  • Global limit: R requests per T seconds
  • Per-user limit: U requests per T seconds per userId
  • Per-experience limit: X requests per T seconds per userExperience

Explain key design choices:

  1. How to structure keys/counters to support multiple dimensions without double-counting
  2. How to evict stale state efficiently
  3. How to deploy and scale in a distributed environment (sharding, coordination, clock skew, idempotency)
  4. How to test correctness and edge cases (bursts, boundary timestamps, window rollover)

Constraints & Assumptions

  • Preserve the scope, facts, inputs, and requested outputs from the prompt above.
  • If the prompt leaves a detail unspecified, state a reasonable assumption before relying on it.
  • Keep the answer interview-ready: concise enough to present, but concrete enough to implement or evaluate.

Clarifying Questions to Ask

  • Clarify users, core use cases, read/write patterns, scale, latency, availability, and data retention.
  • State explicit assumptions before making sizing or architecture decisions.
  • Prioritize the functional path first, then address reliability, security, observability, and rollout.

What a Strong Answer Covers

  • A scoped requirements summary with concrete non-goals and success metrics.
  • API, data model, architecture, consistency, capacity, and operations.
  • Reasoned trade-offs among simple and scalable designs, including bottlenecks and failure modes.
  • A validation, monitoring, migration, and launch plan appropriate for the risk level.

Follow-up Questions

  • What breaks first at 10x traffic or data volume?
  • How would you degrade gracefully during dependency failures?
  • What metrics and alerts would prove the design is healthy after launch?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Roblox•More Software Engineer•Roblox Software Engineer•Roblox System Design•Software Engineer System Design

Your design canvas — auto-saved

PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.