Use Newton's interpolation, as suggested. Just sort the $x$
$$
\begin{array}{ccccccccccccccccccccccc}
x & -3 & & -2 & & 0 & & 1 & & 4 & & 5\\
f & 1 && 2 && 4 && 5 && -1 && -2\\
f^{(1)} && 1 && 1 && 1 && -2 && -1\\
f^{(2)} &&& 0 && 0 && -\frac{3}{4} && \frac{1}{4}\\
f^{(3)} &&&& 0 && -\frac{1}{8} && \frac{1}{5}\\
f^{(4)} &&&&& -\frac{1}{56} && \frac{13}{280}\\
f^{(5)} &&&&&& \frac{9}{1120}\\
\end{array}
$$
Now, $$P = 1 + (x + 3) + 0 (x+3) (x+2) + 0 (x+3) (x+2) x - \frac{1}{56} (x+3) (x+2) x (x-1) - \frac{9}{1120} (x+3) (x+2) x (x-1) (x-4).$$
Or in form
$$
P = 1 + (x + 3) \left(
1 + (x + 2) \left(
0 + x \left(
0 + (x-1)\left(
-\frac{1}{56} + (x-4)\left(
\frac{9}{1120}
\right)\right)\right)\right)\right)
$$
Now we need expand all of that. Let $P(x) \equiv P_1(x) = a_1 + (x - x_1) P_1(x)$ and so on $$P_k(x) = a_k + (x - x_k) P_{k+1}(x).$$
$$
\begin{array}{ccccccccccccccccccccccc}
x_k & -3 && -2 && 0 && 1 && 4 && 5\\
a_k & 1 && 1 && 0 && 0 && -\frac{1}{56} && \frac{9}{1120}\\
\hline
\hline
P_6(x) &&&&&&\frac{9}{1120}\\
P_5(x) &&&&&\frac{9}{1120} && -\frac{1}{20}\\
P_4(x) &&&&\frac{9}{1120} && -\frac{13}{224} && \frac{1}{20}\\
P_3(x) &&&\frac{9}{1120} && -\frac{13}{224} && \frac{1}{20} && 0\\
P_2(x) &&\frac{9}{1120} && -\frac{47}{1120} && -\frac{37}{560} && \frac{1}{10} && 1\\
P_1(x) &\frac{9}{1120} && -\frac{1}{56} && -\frac{43}{224} && -\frac{11}{112} && \frac{13}{10} && 4\\
\end{array}
$$
Finally
$$
P = 4 + \frac{13}{10} x - \frac{11}{112} x^2 - \frac{43}{224}x^3 -\frac{1}{56}x^4 +\frac{9}{1120}x^5.
$$
PS I've made a couple mistakes during computations and was constantly checking my intermediate results with Mathematica. Not sure if it is possible to do all of that in exam conditions.