Google interview question

Implement a function to sample from a multinomial distribution efficiently.

Interview Answer

Anonymous

Mar 11, 2025

Use alias sampling method for O(1) lookup and O(n) preprocessing.