If you're an intern or apprentice then the entire point of you being there is to learn, so ask as much as you can.
Otherwise, time is money, both your time and the time of the person(s) you're asking. Assuming both outcomes are equally likely (being able to figure it out on your own vs not being able to), and assuming that the person you would ask has the time and is willing to help,
if
your time at your value plus the value of you learning
is less than or equal to
their time at their value plus the value of them teaching
then
try to figure it out on your own
else feel free to ask away
Drew Hoover
software developer in A2
I'd add a qualification to my answer (try to find, then ask). Try to find the answer first, not because you're at risk of needlessly bothering someone, but because it will build your muscle for finding answers. Even if you don't find the answer, you'll have a better, more carefully qualified question if you spent an hour trying to answer it first. Most questions are not bothersome, and most devs like answering questions =)