If you add a surfactant in water-oil mixture, surfactant molecules would form micelles wherein the hydrophobic end of the surfactant faces inside the micelle while the hydrophilic end faces the water molecules. Inside these micelles oil particles are attached.
In a exothermic reaction, heat is written as a product (del H is negative), whereas in an endothermic reaction heat is written on the reaction side (del H is positive).
For a, it is endothermic process. We know this because to go from solid to liquid you need to put energy into the system. When we put energy into a chemical system it is said to be an endothermic reaction.
For b, it is exothermic reaction. This is because you have to lose the extra energy to go from less ordered states (gas) to more ordered state (liquid). Gas is less ordered because its molecules are freely moving and such. Another way of thinking about this question is just putting the heat on product side and think if I was going in reverse direction I would put heat in product because I would need to add heat to liquid to turn to gas (and if heat is added to product side we know its exothermic). Two ways of thinking whichever you prefer.