Determining the order of basicity of acetate, phenoxide, hydroperoxide, and hydroxide ions Arrange the following ions in order of basicity:
  (1) $\ce{CH3COO-}$ (acetate)
  (2) $\ce{PhO-}$ (phenoxide)
  (3) $\ce{HOO-}$ (hydroperoxide)
  (4) $\ce{HO-}$ (hydroxide)


The first thing I see is that all of them have the same donor atom, i.e. oxygen.

In both $\ce{CH3COO-}$ and $\ce{PhO-}$, the charge is stabilized by resonance. So, they are least basic, $\ce{PhO-}$ being the less basic among the two as you can see that in case of $\ce{PhO-}$, the number of resonance structures are more than $\ce{CH3COO-}$.

Next, comparing $\ce{HO-}$ and $\ce{HOO-}$ I find that the negative charge on $\ce{O-}$in $\ce{HOO-}$ maybe slightly more stable as the charge may be shared by the other oxygen, whereas $\ce{HO-}$ has no such option.

So I get the basicity order as 4 > 3 > 1 > 2. But the answer is 3 > 4 > 2 > 1. Where am I wrong?
You are partly wrong and partly right. The correct order is $4 &gt; 3 &gt; 2 &gt; 1$ ($\mathrm pK_\mathrm a$ data taken from the Evans table):

$$\begin{array}{cc}
\hline
\text{Molecule} &amp; \mathrm{p}K_\mathrm{a} \\
\hline
\ce{CH3COOH} &amp; 4.76 \\
\ce{C6H5OH} &amp; 9.95 \\
\ce{H2O2} &amp; 11.6 \\
\ce{H2O} &amp; 15.7 \\
\hline
\end{array}$$

Between acetate and phenoxide, phenoxide does have more (non-trivial) resonance forms, but all of them involve putting a negative charge on carbon which is hardly favourable. So, the stabilisation derived from resonance is not much at all.



On the other hand, in acetate, the other major resonance form has the negative charge on an electronegative oxygen. The moral of the story is that the actual number of resonance contributors is not the only deciding factor:



Between hydroperoxide and hydroxide, the $\mathrm{p}K_\mathrm{a}$ values show that you are right in saying that the second oxygen in the hydroperoxide ion stabilises the negative charge. This operates entirely via an inductive effect, though. There is no resonance involved, which partly explains why both ions are more basic than phenoxide and acetate.