Try not to over think it. Interruption isn't a piece of code. It's irrational and subjective day to day based on whatever someone might, or might not feel compelled to interrupt someone else. Either way..
Interruption is the enemy of productivity.
When someone interrupts you for more than 30 seconds, they are saying what you work on at any given moment is not important.
Of course, people aren't that conscious about their actions. It's just what ends up happening.
The best thing to any interruption I have found is:
1) Noise canceling Headphones. I love them. It better be important to make me take them off
2) Drop by visits or questions. Nothing more than 30 seconds. If it is, I say "I have to finish something, can we schedule some time later?"
3) Poor planning on your part does not mean an emergency in my part. That's right. If you become a firefighter you'll attract even more fires.
4) Do not be the path of least resistence. If you can answer their question with one google search, they aren't doing it and instead are asking you because they think it would be quicker. Think about it. One google search. Make others do their due diligence before asking you. I made a bet once. After the first 3 questions a day, If I got the answer for them with one google search within 30 seconds, I get $1.
Set a time or schedule, once or twice a day to discuss items. Be creative, fun, and lighthearted about it, but do get it across that your time is serious, and if others don't take their's as seriously, that's up to them.
Software Development is an art requiring clear, focused, relaxed energy in the mind.
I just signed up today, but I wrote and will shamelessly plug this exact topic that I wrote about yesterday. There's also a fantastic link to Jason Fried's "The Way I Work" that will help you see how he manages interruptions.
Since I am a new user StackMeta won't let me post more than one link here.
check out www . inc.com/magazine/20091101/the-way-i-work-jason-fried-of-37signals_pagen_2.html