The first thing I notice is that $x^2 - x - 1$ is a factor of a cubic polynomial, which means that the other factor must be linear, of the form $cx + d.$ So I can write $ax^3 + bx^2 + 1 = (x^2 - x - 1)(cx + d)$ and expand the right-hand side to compare the coefficients of $x^3, x^2, x$ and the constant terms. Expanding the right-hand side gives $cx^3 + (d - c)x^2 + (-c - d)x - d.$ Comparing the coefficients of $x^3,$ I get $a = c.$ Comparing the coefficients of $x^2,$ I get $b = d - c.$ Comparing the coefficients of $x,$ I get $0 = -c - d,$ which implies $c = -d.$ Comparing the constant terms, I get $1 = -d,$ which implies $d = -1.$ Therefore, $c = 1$ and $b = d - c = -1 - 1 = -2.$ 
If $a$ and $b$ are integers such that $x^2 - x - 1$ is a factor of $ax^3 + bx^2 + 1,$ find $b.$