One way to factor the polynomial $g(x)=2x^2+9x-5$ in $\mathbb{Q}[x]$ $\bigl($and then in $\mathbb{Z}[x]$$\bigr)$ is by 'guessing' the rational zeros of $g(x)$. The problem
Given a polynomial $f(x)=a_nx^n+a_{n-1}x^{n-1}+\cdots+a_1x+a_0$ with integer coefficients, where $a_n\neq 0$ and $a_0\neq 0$, decide whether it has rational zeros, and in case it has them, find them.
has an 'algorithmic' solution. If a reduced fraction $p/q$ is a zero of $f(x)$, then
$$
a_np^n + a_{n-1}p^{n-1}q + \cdots + a_1p\mspace{2mu}q^{n-1} + a_0q^n = 0~,
$$
and it follows that $p$ divides $a_0$ while $q$ divides $a_n$. If $p_1$, $\ldots$, $p_r$ are all positive divisors of $a_0$
and $q_1$, $\ldots$, $q_s$ are all positive divisors of $a_n$, then the rational zeros of $f(x)$, if they exist, must be among
the fractions $\pm \mspace{2mu}p_i/q_j$, $1\leq i\leq r$, $1\leq j\leq s$. For the given quadratic polynomial $g$ you have $p_1=1$, $p_2=5$, $q_1=1$, $q_2=2$, so you have to check eight fractions. This 'guess a rational root'
is not an extremely efficient procedure for quadratic polynomials, since in this case you have an explicit formula for the two roots. However, if you were given instead the polynomial
$$
f(x)=2x^{10}+7x^9+x^8-x^7-4x^6-2x^5+8x^4-16x^2-17x-5~,
$$
then you would have to guess since you do not have explicit formulas for roots. Even when $f(x)$ is
a cubic polynomial, where you do have explicit Cardano's formulas for the roots, you'd be better off guessing, because it is not always easy do decide whether the values produced by Cardano's formulas are rational: the cubic equation $x^3-15x-4=0$ is a historical example (Bombelli 1572).