linkjobai / Design a Hit Counter (LeetCode 362) and How It Scales
0 likes
0 forks
1 files
Last active 19 hours ago
Interview prep notes
Design a Hit Counter (LeetCode 362) and How It Scales
"Design a hit counter that returns the number of hits in the past 5 minutes" starts as a data-structure question and often turns into a mini system design discussion.
Version 1: a queue of timestamps
from collections import deque
class HitCounter:
Newer
Older