Give the players a Rubik's cube and tell them they must solve it or their PC's die.

I loathe in-game riddles like this. They are fine if the DM allows for both alternate solutions (like bashing down the door or knock), and for the fact that the characters and players know different things.