I've come across situations where the question asked is "How do you do X in Java?" and one of the answers is "Can someone help me do Y?"
Should I flag that response as “Requires Moderator attention”? Or should I just downvote it?
Flag it for moderator attention. Go nuts with the thing.
You have 10 flags for moderator attention a day, use them. There can never be enough flags for moderator attention.
Write out why you think it should be cast into the hoary fires of Hoggarth and a mod will come along and blast that salt walker into the back of the supermarket.
Downvote and flag as spam/offensive in addition if you feel it's right.
I generally post a comment to the response, politely explaining why the post is inappropriate, and asking the poster to delete it. If it is spam or abusive, you can flag it as such, and the system will delete it automatically when six such flags are accumulated.
If all that fails, it is entirely appropriate to flag for moderator attention.