For me if I get into a topic (like 2-3 hours focus time) then interruptions are OK, I won't drop context until end of the day.
If the interruptions happen early in the morning so I never have the 2-3 hours boot up time, then that day is pretty much a zero from lines of code produced perspective.
Note: if it's some trivial boilerplate code then I can even be productive without booting up and with constant interruptions, this only applies to things I don't know how to do and need to research/think