I'am sure the problem exist for everybody. This is finally a context switch a bit like our CPUs.
Part of the problem may be purelly that you lost some information you need to acquire again, true. But the brain is now focussed on the interruption and may take some time to just not think of it anymore.
As to split a problem into small tasks, this is important and help but is itself a complex task... And you may as well forget what the tasks where if you are interrupted. You can write down things but then you make you brain slow down, to work a speed of writing/reading instead of its own naive speed.
As for headphones, if you play music and not just cancel the noise, it decrease concentration. It has been proved that pure silence is better than music and it seems logical. A part of you concentrate on the music. It is an interruption by itself. How I remember that one that our prefered music with my girlfriend or simply, hey I like it or no, I'll go to next track.
It is sure that being organized to live with interruptions if you cannot avoid them greatly improve your productivity. There many tricks. People for example switch to tasks that do not require much concentration at hours when they are most likely to be interrupted or between 2 meetings. Some people would just say to go back to them later and stay focussed. You can also concentrate on reading mail/chats conversations and all at certains hours/time (like every hours or when you have a slow compilation blocking you).
I also simply know many people that when they know they need to have max concentration go to a meeting room where they are alone, put their chat status on do not disturb and so can be concentrated on the task for a long time and make significant progress.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.