Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
petters
76 days ago
|
parent
|
context
|
favorite
| on:
Reservoir Sampling
This also got me past one interview. I came up with k/n but now I think it's better to just generate a random float in [0, 1] and keep the k largest ones
Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: