Always know how to answer this
The key question you have to ask yourself is
What do these symbols mean?
Heat
The $Q$ means heat, of course, but does it mean heat added to or removed from the system.
In almost all cases it takes the sense of "added to".
Work
Should $W$ be the work done on the system or the work done by the system?
If you are primarily interested in the system than it should be the work do on the system which has the added bonus of meaning that both symbols mean energy added to the system.
However, the main practical application of early thermodynamics was in the building of engines. And when you are designing an engine the things you worry about are how much fuel you put in and how much work you get out. The obvious convention for a engine designer is to have $W$ represent the work done by their machine, meaning that $W$ represents energy leaving the system.
First Law
So the engineers version of the First law is
$$ \Delta U = Q - W \tag{engineering} \;,$$
while most chemists and physicists prefer
$$ \Delta U = Q + W \tag{science} \;.$$
Side effects of this choice
Note that the effects of this choice reverberate through the math. Taking the case of a fluid system the mechanical work is
$$ W = +P \,\mathrm{d}V \tag{engineering} \;, $$
or
$$ W = -P \,\mathrm{d}V \tag{science} \;, $$
and that means that the way you write the various thermodynamic potentials changes as well.
Comparing texts that use different sign conventions for work is a painstaking undertaking.
Aside: Reif's textbook is the only one I am familiar with to use two symbols to represent both meanings.
- $W$ is the work done by the system
- $\mathcal{W}$ is the work done on the system
That way you can write the first law in the manner that makes the easiest sign handling for each problem you come to. I've been using this approach in all the writing I do for my students and even adopts some of Reif's other notational conventions that I don't care much for ($\bar{E}$ for the internal energy? Really?) just so that my students can compare the notes I give them directly to one of their texts.