microsoft · data-scientist · data-structures

How would you design a rate limiter that supports burst traffic and quick lookups?

Difficulty: Medium

Overview

Evaluates understanding of sliding window, token bucket, and data structure choices.

Example Answer

  • Use a token bucket stored in Redis with atomic increments and expirations.
  • Sliding window counters can be approximated with two buckets for simplicity.

Tips

  • Discuss token bucket vs. sliding window log/counter.
  • Highlight per-user keying and TTL.
  • Talk about distributed consistency if needed.

Your Actions

Bookmarks show up in Profile → Career Prep → Saved Questions and on the company page under Saved Questions.

AI Assistant