Find possible formulas for polynomials with the given properties.

a) f has degree ≤2, f(0) = f(1) = f(2) = 1.

b) f is third degree with f(-3) = 0, f(1) = 0, f(4) = 0 and f(2) = 5.

For a) I know that x values 0, 1, and 2 have y values of 1. These points should look like their in a straight formation. But how we find the formula for this? And what about b)?

Please explain and show me the process to solving these problems. Thanks.