I got this problem from Rustan Leino, who got it from both Jim Saxe and Pierre Nallet.
I solved it and wrote up my solution.
A king has a daughter and wants to choose the man she will marry. There are three suitors from whom to choose, a Knight, a Knave, and a Commoner. The three suitors know which man is which, but the king does not. The king wants to avoid choosing the Commoner as the bridegroom.
The king knows that the Knight always speaks the truth, the Knave always lies, and the Commoner can do either. He is permitted to ask one of them one yes/no question, and then must choose who gets to marry the princess. What question should the king ask and how should he choose the bridegroom?
The king should arbitrarily assign names to them: Albert, Brian, and Charles. The king should point at Brian and ask Albert, "If I were to ask you if the person I'm pointing at was the Commoner, what would you say?" If Albert says "Yes", the king should choose Charles; otherwise, the king should choose Brian.
Here's why this works:
If Albert is the Commoner, then the king will automatically succeed in avoiding the Commoner, since in no case does he ever choose Albert. Thus, we only have to consider the cases where Albert is the Knight or Knave.
Interestingly, if you know someone is a Knight or a Knave, you can get him to give you the answer to a question $Q$ by asking him "If I were to ask you $Q$, what would you say?" The reason is as follows. If he's the Knight, he'll of course answer correctly. If he's the Knave, he would lie if he were asked $Q$. So, when asked what he would answer if asked $Q$, he must lie and give the opposite answer to what he would say if he answered with a lie. In other words, he must give an answer that answers $Q$ correctly.
Thus, the king can treat Albert's answer as if it is directly telling whether Brian is the Commoner. He then chooses accordingly.