Tag: random
Interview Questions
- Pick one item uniformly from a stream
- Deal k cards uniformly at random
- Build a fair d7 from a fair d5
- Uniform integer from a fair coin
- Implement a fair shuffle
- Estimate pi by Monte Carlo
- Pick one uniformly random item from a stream
- Return a random node's value from a linked list you can only read once
- Return a uniformly random index of the maximum in a stream
- Reservoir sampling from a stream