PracHub
QuestionsPremiumLearningGuidesInterview PrepCoaches
|Home/System Design/Roblox

Design sliding-window rate limiter with multi-keys

Last updated: May 10, 2026

Quick Overview

This question evaluates understanding of precise sliding-window rate limiting, multi-dimensional counters, time-series state management, and distributed systems concerns such as sharding, clock skew, idempotency, and scalable state eviction.

  • 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: This question evaluates understanding of precise sliding-window rate limiting, multi-dimensional counters, time-series state management, and distributed systems concerns such as sharding, clock skew, idempotency, and scalable state eviction.

Related Interview Questions

  • Design Multi-Dimensional Request Rate Limiting - Roblox (easy)
  • Design a Scalable Likes System - Roblox (medium)
  • Design favorites and social game recommendations - Roblox (medium)
  • Design a rate limiter - Roblox (medium)
  • Design a Scalable Like Counter - Roblox (medium)
Roblox logo
Roblox
Jul 16, 2025, 12:00 AM
Software Engineer
Technical Screen
System Design
38
0

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)

Solution

Show

Comments (0)

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
PracHub

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

Product

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

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL 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.