Let $p$ be a polynomial of known degree $n$:
$$p(x) = a_0 + a_1 x + \ldots + a_n x^n$$
Suppose we have a magic black box that can evaluate the polynomial for us. How could one then determine the coefficients $a_i$? Lagrange polynomials provide a solution, but perhaps we can do better given that we have freedom to choose where to evaluate $p$?
Of course I'm not really sure what I mean by 'better' - minimal number of operations? Perhaps there are optimal solutions for a given degree, but is tricky in general. I'll start you off with my solution for the linear case:
$$\begin{align*}a_0 &= p(0) \\ a_1 &= p(1) - a_0\end{align*}$$
And for a quadratic:
$$\begin{align*} a_0 &= p(0) \\ a_2 &= \frac{1}{2}\left[p(-1) + p(1) - 2a_0\right] \\ a_1 &= p(1) - a_2 - a_0 \end{align*}$$