molarity of a solution is defined as the number of moles of solute in 1 L of solution.
here we are given 4 mol of NaOH to be dissolved in 2 L of water
the number of moles of NaOH in 2 L of water - 4 mol
therefore number of NaOH moles in 1 L of water - 4/2 = 2 mol of NaOH
there are then 2 mol of NaOH in 1 L
therefore molarity of solution is 2 mol/L