To start off, all of these ions have the same number of electrons. So electronegativity and charges are going to determine ionic radium.
N3- has an overall negative charge of 3. In N3- we have 3 more electrons than protons, and a large negative charge. This is going to cause the electrons to be forced away from the nucleus, in order to 'make room' for the three extra electrons.
Mg2+ has an overall positive charge of 2. This means there will be less electrons compared to the number of protons. The electrons are going to 'go towards' the positively charged nucleus, making the ionic radius of Mg2+ small, compared to the rest of the elements.
Everything in-between follows the same trend.
1) Largest to smallest: N3-, O2-, F-, Na+, Mg2+
2) Largest to smallest: P3-, S2-, Cl-, K+, Ca2+
Note where these elements are on the periodic table. Note that they are isoelectronic; i.e., all have 10 electrons. Arranged by periodic table they would show up as
..................N, O, F,
So which element has the smallest number of protons? That is N(7 protons). The protons in N can not attract those 10 electrons as strongly as any of the others; therefore, N^3- must be the largest and they become smaller as you progress left to right. Does that work out? Yes. Mg has 12 protons and will attract those outside electrons stronger than any other ion listed. Mg2+ will be the smallest.