So, traps, puzzles and other conundrums are a vital aspect to any dungeon, as they represent a variance of challenge in the dungeon by whatever mad or alien intelligence designed such a place. This shows that they prepared not just slavering hordes of monsters for those weak of flesh and unskilled of blade, but also cunning and calculated enigmas to foil the Luddite and fuddle the ignorant.
But... what if I don’t care about your riddle, and my barbarian punches your Sphinx in the face? What if my barbarian is wearing a manticore pelt, and has the scars to prove himself in battle and the taste of Lion’s blood in his nose?
Or... what if my wizard uses paradimensional calculus to lessen gravity’s hold on the Giant Boulder that is rolling towards us, thus allowing even one of my moderate physique to treat that trap as a child’s balloon? What if I just use Acheron’s Finite Sub-Atomic Reductor to disintegrate the trap on a molecular level?
Solving a puzzle directly is but one way of handling the scenario. A successful skill check by a thief and the party begins to loot the room. Nothing wrong with that, although a descriptor of how the puzzle is solved from the player whets my palate considerably more than just a mere number. But what if you don’t have a thief in your party? There quite literally has to be another way.
Secondary options for traps and puzzles maximizes choice (which I firmly believe is a good thing), for a party with with or without appropriately skilled members. It’s the same concept that one could talk to those orcs in room 2C, or one could just stab the lost merchant king in room 16B, but likely won’t. The dilemma here is that frequency of players getting stuck on puzzles and traps seems to happen much more often in the games I DM and PC.
At first glance, this thought that we should have multiple ways around a trap or puzzle seems counter intuitive. “But Crypt Thing,” I hear you say, “Shouldn’t my puzzles stop the PCs? Isn’t that the point of placing them in a dungeon by its creator?” Well, yes, but no. The in-character reason is yes, but the out-of-character reason is to challenge the PCs and make them think either outside the box or on the fly. Your goal should be to provide a reasonable challenge that the players can feel accomplished for having overcome as their characters.
Now, why not stop them? Because stopping the flow of the story, the game, and the adventure kills the mood. I’m not suggesting that characters shouldn’t fail, as failure stops none of those, and in the story’s case adds narrative growth. They’re welcome to try again (later, Rest and a wandering monster check) or another path (because your dungeon should absolutely have other paths). But I am suggesting that nothing is worse than only being able to progress once a puzzle has been beaten and that puzzle has your players stumped, especially if there is only one way to solve it. Riddles are a frequent offender for this category.
I would say that, a narrative and canny way to create a puzzle or series of puzzles is to merely make a problem and not invent a solution, rather let the players come up with the solution themselves, and have that solution work.
Another, slightly more game-y way to handle things is to break down how characters interact with the world. Let’s say in this case, our players interact with the world with might, with cunning, with skill, and with magic. For said trap or puzzle, I would have four different ways to negate or solve it, one for each method of interaction. And of course, I would hope that my players would do more than just roll a die when asked and then ask what happens in return. The goal here is to get them to think, remember? Let them describe said victory, both as a reward but also as an exercise in describing their character during their spotlight.
Which is another reason to vary the method by which puzzles or traps can be solved, as well as a reason to include them in your dungeon: it moves the spotlight around the room, and helps weave the whole party into the narrative as being capable Adventurers.