The polynomial has the form f(x)=a(x+2)(x-5)2, where a is any number.
f(x)=a(x+2)(x2-10x+25)=ax3-10ax2+25ax+2ax2-20ax+50a,
f(x)=ax3-8ax2+5ax+50a. If a=1, we have f(x)=x3-8x2+5x+50 as an example.
To prove that the polynomial is correct, plug in x=-2:
f(-2)=-8-32-10+50=0 (so x=-2 is a root or zero); plug in x=5:
f(5)=125-200+25+50=0 (so x=5 is a root or zero).
You can also draw the graph and look at the two x intercepts.