Hydrogentaion of alkenes in absence of catalysts
The main point of these exercises is that not all C=C bonds are created equal. Their reactivity towards hydrogenation can be influenced by steric effects and specifically applying here, the degree of substitution of the double bond. So for the bottom example, the exocyclic disubstituted double bond will react but not the endocyclic one which is much more stable. Now here there is some uncertainty in this exercise since the actual result is dependent on the exact conditions which are not provided. For example hydrogenations are well known to be very capricious on the selection of metal catalyst and $\ce{Pd}$  can give a different result than using $\ce{Pt}$ or $\ce{Rh}$. And this only an example as there are so many different set of conditions possible with variable results.

The top one is an even worse exercise in the sense that the outcome is very specific on the exact conditions. Now, knowing the exact outcome we can rationalise as follows: Here the electronics also play a role and this diene because of conjugation will be more stable and thus more resistant towards hydrogenation. When one of the exocyclic bonds gets reduced (even if it only partially does so) then in the intermediate formed the other unreacted double bond will isomerise (much much faster than the reduction of the exocyclic conjugated bond in the starting material)  to the more stable product with the  endocyclic double bond i.e. Structure a. This structure will be unreactive towards further reduction and eventually will be the sole product of the reaction.