https://github.com/ericfrancis12/udp-packet-rate-limiter
udp-packet-rate-limiter
https://github.com/ericfrancis12/udp-packet-rate-limiter
Last synced: 2 months ago
JSON representation
udp-packet-rate-limiter
- Host: GitHub
- URL: https://github.com/ericfrancis12/udp-packet-rate-limiter
- Owner: EricFrancis12
- License: mit
- Created: 2024-12-09T06:00:18.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-12-09T06:04:34.000Z (6 months ago)
- Last Synced: 2025-02-05T22:59:31.784Z (4 months ago)
- Language: Go
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UDP Packet Rate Limiter
## Problem
Take a continuous stream of timestamps on stdin
Example Input: 1074 1074 1076 1076 1076 1076
The input represents a timestamp at which a UDP packet was received from a particular customer.
For each input, respond with either a 'd' which instructs the router to DROP the packet, or an 'a' which instructs the router to ACCEPT the packet
Accept as many packets as possible without exceeding:
3 packets per 1 second
10 packets per 5 seconds
## Usage
```bash
./test.sh
```## Source
https://leetcode.com/discuss/interview-question/1424264/cloudflare-oa