← Questions

Prove an incremental shuffle is uniform

0
ModalCodingLast asked Jul 2026

A coding interview question asked in Modal's technical phone screen, last asked Jul 2026. It tests probability, randomized algorithms and proofs.

A shuffle builds its result one position at a time, the forward Fisher–Yates shuffle. Prove that for n distinct elements every ordering comes out with probability exactly 1/n!, and explain which small changes to the code break that.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Modal · Technical phone screen · Last asked Jul 2026

What it tests

probability · randomized algorithms · proofs

Your code and the AI tutor open when you unlock this question.