For water heating in a microwave:
Heat (q): The microwave radiates electromagnetic energy that is absorbed by water molecules, so q = +ve
Work (w): As water heats and boils, it expands against atmospheric pressure. The system does work on the surroundings, so w = -ve
Internal Energy (ΔU): From the first law, ΔU = q + w. Since heat absorbed (+ve) is much larger in magnitude than work done against atmosphere (-ve), the net change is ΔU = +ve (confirmed by temperature increase from 5°C to boiling)
Therefore: q = +ve, w = -ve, ΔU = +ve