Let $S_D$ be Dave's speed, and $S_J$ be Jess's. Say they meet at time $t$ at distance $d_1$ from $A$ and $d_2$ from $B$. We can write $t=d_1/S_D$ and $t = d_2/S_J$ and combine them into $$\frac{d_1}{d_2} = \frac{S_D}{S_J}.$$
On the latter part of the journey, we can write similar equations $40=d_2/S_D$ and $90=d_1/S_J$ and combine these into
$$\frac{d_1}{d_2} = \frac{90S_J}{40S_D}.$$
Combining this with the equation above we get
$$90S_J^2 = 40S_D^2,$$
or $$S_J = \frac23 S_D.$$
$S_D = 36/60$ km/minute so $S_J=24/60$ km/minute, or $24$ kph.