linkjobai / Design a Hit Counter (LeetCode 362) and How It Scales
0 Lajky
0 Forky
1 Soubory
Naposledy aktivní 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:
Novější
Starší