New
ML System Design & SQL tracks just landed
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
JobRadar
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Coding Question
AI Insights
Quick Summary
Process a sequence of strictly increasing request timestamps to decide whether to allow or reject each one.
A request is allowed only if it does not cause the count of previously allowed requests in the trailing window to exceed a given limit.
Rejected requests are ignored for capacity tracking and never influence future window calculations.
What This Tests
Sliding window technique with dynamic state tracking
Efficient FIFO data structure management for temporal boundaries
Time complexity optimization under large input constraints
Conditional state transitions based on historical permitted events
Common Patterns
Sliding Window
Queue / Deque
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Accepted
3.4k
/6.2k
Acceptance Rate
55.3%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
timestamps =
maxRequests =
windowSize =
Output
Expected