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
OpenAI
Coding Question
AI Insights
Quick Summary
Track chat events per user within a fixed trailing time window.
Discard expired timestamps proactively to guarantee constant memory usage.
Support efficient event recording and range-count queries under strict timestamp ordering.
What This Tests
Sliding window management with monotonic input guarantees
Per-entity state isolation using hash maps
Efficient ordered sequence operations and memory pruning
Trade-offs between lazy cleanup and query-time scanning
Common Patterns
Sliding Window
Hashing
Collapse
Hint 1
Hint 2
Hint 3
What Interviewers May Ask Next
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
Output
Expected