There is a list of questions with answers. There is a list of characters. For each character in the database are recorded the correct answers to the questions. When the user answers the question, some of the characters are swept aside, because the user response is not the same as the answer for these characters. Then select a random question, the answer to which can eliminate some characters. The result is one option. If not too much else, looking for an option that would, if the user once gave the wrong answer. And so on.