All challenges
Code AnalysisBeginner 60s

Window boundary allows double rate

A client sends 100 at second 59 and 100 at second 61. What happens?
Starter code
# limit: 100 req/min
def allow(now):
    w = int(now // 60)
    if counts[w] >= 100: return False
    counts[w] += 1
    return True

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle