Все Новий

user:thomas gists створені користувачем

title:mygist gists з наданим ім'ям

filename:myfile.txt gists мають файли з наданим ім'ям

extension:yml gists мають файли з наданим розширенням

language:go gists мають файли з наданою мовою

topic:homelab gists with given topic

Реєстрація

Увійти


Все Новий Реєстрація Увійти

All gists matching topic interview

Нещодавні зверху створені
Нещодавні знизу створені
Нещодавні зверху оновлені
Нещодавні знизу оновлені

linkjobai / Design a Hit Counter (LeetCode 362) and How It Scales

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 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:
Новіше Пізніше

Працює на Opengist ⋅ Load: 14ms⋅

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