If you can quickly finish your prayer just in time to join the Imam before he offers the first takbeer, you should continue you prayer. Otherwise, interrupt it.
If you can quickly finish your prayer just in time to join the Imam before he offers the first takbeer, you should continue you prayer. Otherwise, interrupt it.