On the job seeking perspective, what you said is right. Typically what people do is signing an NDA, but even with that, the question/solution still sometimes leak on the Internet.
On the learning scenario, it's sorta true, but mostly sharing the solution would ruin the motivation, at least for me personally. If I know there's a solution sitting there, I wouldn't be interested in repeating it again.
I know it's sorta silly... But my mind works best when I only focus on the problem, and how to solve it. As long as I know there's a solution, I couldn't stop myself looking at it whenever I was stuck at any tiny bit.