I've long been a fan of things like the 'Dirty Dungeon' where you get the players to build the dungeon for you. I especially love the execution in that idea is that it combines 'leg work' (to steal the shadowrun term) and gives a way for the players to design the types of challenges they face. That last part I like even more than being spared the requirement of having to build my own dungeon. Why? Because when the players build the dungeon for themselves, they tend to put in the types of challenges they want to face.
That said, not every group is comfortable building their own dungeons. Or they want the surprise and challenge of going against your dungeon/puzzles/etc. While that does make it harder to figure out what type of challenges your players want to face, it doesn't absolve you of your responsibility to make challenges the players will have fun with and want to see.
So how do you do that?
One way is to look at the character sheets for your PCs. Players like feeling strong, so putting challenges in that let them flex those muscles can be good. At the same time, this lets you gear challenges to specific PCs giving everyone a time to shine. You also can see some areas where perhaps the group as a whole has a bit of a weakness. For example, in a Star Wars game I'm in, the group doesn't have anyone who is particularly strong at social interaction. As a GM for that group (I'm not the GM for that) I would take that as a sign the group as a whole isn't particularly interested in social challenges. However, that doesn't mean they get no social challenges. Just that I want to put them at meaningful - if rare - times to challenge them and make them deal with an area they're weak as a group to see what they do.
The second easiest way to find out what your players are actually interested in seeing for challenge types? This one is kind of a cheat, because it will get not only what the player is interested in, but what they're interested in right now. That way?
Just ask them. When the game is going into a new area or section, in the post-game discussion ask the players what kind of challenges they're looking to face. You don't have to go specific, but you can work things in. Do they want to see more combat? Do they want more puzzles? Social interaction? parties? Tense situations that can go combat or social depending how they play it?
Regardless of your approach though, a game is supposed to be fun and that means putting fun obstacles in the way. The best way to know what kind of obstacles are fun is to ask. Use that. Build a game that you will have fun with, but also that your PCs will have fun with. It can only help the game.
And check out that Dirty Dungeon. It's a fun idea.