Skip to main content
1 of 3
tohster
  • 41.3k
  • 14
  • 108
  • 140

350 is not very many questions.

Why don't you just shuffle the list when the user starts the game and avoid duplicates altogether?

This takes very little processing power (even a crappy mobile phone can do the operation very quickly) and minimal memory (store pointers or indexes to questions and not the question itself....the order can be stored in memory client side).

If you are picking questions sequentially at random, there is a VERY high probability that the user will see a question she has answered recently.

Shuffling is a conventional approach to this pattern. It's used by music players to randomize play lists while avoiding duplicates.

tohster
  • 41.3k
  • 14
  • 108
  • 140