Všechno Nové

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Registrovat

Přihlásit se


Všechno Nové Registrovat Přihlásit se

All gists matching topic interview

Nedávno Vytvořeno
Nejméně nedávno Vytvořeno
Nedávno Aktualizováno
Nejméně nedávno Aktualizováno

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
interview

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ší

Vytvořeno pomocí Opengist ⋅ Load: 14ms⋅

Čeština
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文