Google Interview Question

traversing through a binary tree, how to get random numbers with different probabilities