As, zebu says, the key to unlocking the solution is to verify the 4 triangles are right angled.
Everybody seems to have assumed they are by just looking at the sketch. However, those marking the paper may want to see proof because without it, using Pythagoras to calculate the length of the unknown side may not be considered valid.
So, the sum of the internal angles of a polygon is (2n-4) * 90 (where n is the number of sides). For an octagon this becomes (16-4) * 90 = 1080 degrees. So each internal angle is 1080/8 = 135 degrees.
At the point where two octagons meet a triangle there are two angles of 135 degrees, so the remaining angle (that of the triangle) must be 360-270 = 90.