Generally, when I say the amidah with a minyan, I'm one of the last (if not the last) persons finishing. This means I'm still at the amidah when the kaddish is recited. And I don't know if I should keep praying, respond amen, or keep silent. What should I do when this happens?
The Shulchan Aruch says that one should not answer to kaddish or kedusha in the middle of amidah. He says that one should stop praying, listen and lechaven and that will be as though one answered.
In Pninei Halacha Rabbi Eliezer Melamed brings sources that some say that doing so would constitute a hefsek. His conclusion is that one should wait and listen, as the Shulchan Aruch says, unless it intereferes with one's kavana, in which case it is allowed to go by those who say that it is forbidden to stop.