linkjobai / Design a Hit Counter (LeetCode 362) and How It Scales
0 mi piace
0 forks
1 files
Ultima volta attivo 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:
Più nuovi
Più vecchi