Google Interview Question

Pthread, probability, regular expression