PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Ramp

Implement a Per-IP Sliding Window Rate Limiter

Last updated: Jul 2, 2026

Quick Overview

This Ramp software engineering question evaluates implementation of a per-IP sliding window rate limiter. It prepares candidates to discuss time-window data structures, memory cleanup, concurrency concerns, and operational behavior under traffic spikes.

  • medium
  • Ramp
  • Software Engineering Fundamentals
  • Software Engineer

Implement a Per-IP Sliding Window Rate Limiter

Company: Ramp

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Technical Screen

Given sorted request timestamps, matching IP addresses, a request limit, and a time-window length, return an array where `1` means the request is accepted and `0` means it is rejected. For each IP, at most `limit` accepted requests may occur within any window of length `timeWindow`. ### Constraints & Assumptions - Timestamps are sorted in nondecreasing order. - The window is per IP address. - Rejected requests should not count against future accepted-request limits. - Return one decision per input request. ### Clarifying Questions to Ask - Is the time window inclusive on both ends or half-open? - Should rejected requests be tracked at all? - Can multiple requests from the same IP share a timestamp? - What are the input size limits? - Are IPs strings or numeric ids? ### What a Strong Answer Covers ```premium-lock What a Strong Answer Covers ``` ### Follow-up Questions - How would this run in a distributed system? - How would you implement token bucket instead? - How would memory be bounded for many inactive IPs? - How would you explain rejected versus accepted request accounting?

Quick Answer: This Ramp software engineering question evaluates implementation of a per-IP sliding window rate limiter. It prepares candidates to discuss time-window data structures, memory cleanup, concurrency concerns, and operational behavior under traffic spikes.

Related Interview Questions

  • Implement Spreadsheet Cells with Dependencies - Ramp (medium)
  • Implement a Single-Screen Tic-Tac-Toe Game with State Management - Ramp (medium)
  • Design Calendar Event CRUD with Unit Tests - Ramp (hard)
  • Find a User's Airport at a Given Time from Flight Records - Ramp (medium)
  • Navigate a Maze Through a Next-Step API - Ramp (medium)
|Home/Software Engineering Fundamentals/Ramp

Implement a Per-IP Sliding Window Rate Limiter

Ramp logo
Ramp
Jul 2, 2026, 7:02 PM
mediumSoftware EngineerTechnical ScreenSoftware Engineering Fundamentals
1
0

Given sorted request timestamps, matching IP addresses, a request limit, and a time-window length, return an array where 1 means the request is accepted and 0 means it is rejected. For each IP, at most limit accepted requests may occur within any window of length timeWindow.

Constraints & Assumptions

  • Timestamps are sorted in nondecreasing order.
  • The window is per IP address.
  • Rejected requests should not count against future accepted-request limits.
  • Return one decision per input request.

Clarifying Questions to Ask

  • Is the time window inclusive on both ends or half-open?
  • Should rejected requests be tracked at all?
  • Can multiple requests from the same IP share a timestamp?
  • What are the input size limits?
  • Are IPs strings or numeric ids?

What a Strong Answer Covers Premium

Follow-up Questions

  • How would this run in a distributed system?
  • How would you implement token bucket instead?
  • How would memory be bounded for many inactive IPs?
  • How would you explain rejected versus accepted request accounting?
Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Ramp•More Software Engineer•Ramp Software Engineer•Ramp Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 8,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
  • 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.