Jane Street Interview Question

Some probability and number theory puzzles