With a bit of cleverness, we may write 2d^2+19d+5q-8 = 2(d^2+7d-4) + 5(d+q).
But d^2 + 7d - 4=0, because this is what it means for d to be a root of the given quadratic.
This leaves 5(d+q). By Vieta's formula, we know d+q = -7, so 5(d+q)=5(-7)=-35.
Solution 2:
You don't necessarily need to be clever: we can also substitute d^2 = -7d + 4 to change our expression to the equivalent 2(-7d+4) + 19d + 5q - 8 = -14d + 8 + 19d + 5q - 8 = 5(d+q) = 5(-7) = -35.
Notice, interestingly, that we can calculate this expression without knowing the values of d and q, and without knowing which root is being called d, and which is q!