# Category: Interesting Read

## Caching Algorithm

## Unique ID generation in distributed systems

Before starting out, we listed out what features were essential in our system: * Generated IDs should be sortable by time IDs should ideally be 64 bits (for smaller indexes, and better storage in systems like Redis) The basis for this is the initial bits(40) represent timestamp and the rest of the bit is formed… Continue reading Unique ID generation in distributed systems

## Reservoir sampling

Proof 1 , Explanation Simple explanation on quora

## Generating Random Numbers without Modulo Bias

http://stackoverflow.com/questions/10984974/why-do-people-say-there-is-modulo-bias-when-using-a-random-number-generator https://zuttobenkyou.wordpress.com/2012/10/18/generating-random-numbers-without-modulo-bias/ The random numbers generated using modulo are biased. Check the above article. The correct way of implementation is also specified above.

## Shuffle an array

The general method for shuffling is biased. Check this - https://spin.atomicobject.com/2014/08/11/fisher-yates-shuffle-randomization-algorithm/ and http://www.i-programmer.info/programming/theory/2744-how-not-to-shuffle-the-kunth-fisher-yates-algorithm.html When shuffling the maximum number of possible outcome can't be more then n!( n is the number of items being shuffled). So if the algo generate more then n! possible outcome then the algo is biased. The Knuth Fisher-Yates Algorithm produces unbiased shuffled outcome. It… Continue reading Shuffle an array

## Good to Know Concept

How do giant sites like Facebook & Google check Username or Domain availability, so fast? https://en.wikipedia.org/wiki/Josephus_problem - dynamic prog What is the exact use of a MAC address? - Youtube