When either of the transistors are off (ie, inputs A or B are LOW) the connection between output and ground is open. In that case the output is HIGH. You can better picture this case by removing the transistors from the circuit.
To change that one must turn on both inputs (change both transistor bases signals to HIGH) so that the output gets connected to ground (LOW). You can picture this case by shorting emitter-collector of each transistor, or replacing the connections by a wire.
That's exactly the truth table of a NAND: output is only LOW when both inputs A and B are HIGH.
You don't need to memorise every possible combination of transistors to answer questions like these. To solve problems like the one presented, and this other one linked in a comment below, you should reason like I'm doing here.
You need to understand how a transistor works (as a switch in this case). Then you can then tell whether the transistor is conducting or not. If it is conducting, you can simplify the circuit by replacing the collector-emitter connection with a short (ie., a wire). If it is not conducting, you can replace the connection with an open circuit. Then you solve the resulting circuits.
Of course, I'm oversimplifying things, but only for didactical purposes. Transistors have may other properties that we abstracted here, but that should be considered in real life as it will affect the outcomes of such circuits.