The products of combusting a hydrocarbon with excess oxygen are always carbon dioxide and water.
Ignoring the fact that most of the water vapor would condense at room temperature, and that extra water vapor would be introduced by the NaOH solution:
The NaOH would absorb all the CO2, so the mole fraction of H2O in the mixture of products would
be 35 / 75, and so the mole fraction of CO2 would be 40 / 75.
There is one mole of C in each mole of CO2, and one mole of H2 in each mole of water, so if you take a hypothetical sample of 75 moles of the product mixture there would be 35 moles of H2 and 40 moles of C.
Divide by the smaller number of moles:
(40 mol C) / 35 mol = 8/7
(35 mol H2) / 35 mol = 1
In order to have integer coefficients, multiply by 7:
C8(H2)7 = C8H14
Enough information was not given to determine the molecular formula of the mysterious hydrocarbon of mystery. What is shown above is actually an empirical formula. There is no real reason to suppose the molecular formula is not C16H28 or C24H42 or any other higher multiple, except that the smaller molecules seem more likely.
C8H14 could be an octadiene or an octyne.