(d) According to first law of thermodynamics
$\mathrm{\Delta}Q = \mathrm{\Delta}U + \mathrm{\Delta}W$
$\mathrm{\Delta}U = \mathrm{\Delta}Q - \mathrm{\Delta}W$
Here $\mathrm{\Delta}Q = 35J,\ \mathrm{\Delta}W = - 15J$
$\therefore\ \mathrm{\Delta}U = 35J - ( - 15J) = 50J$
Note : $\mathrm{\Delta}W$ is negative because work is done on the system