The mezuzah is supposed to be placed on the right side of the entrance when going into the house. Yet I have seen a number of people who place the mezuzah of their door going to the deck in the back of their house on the right side of the exit leaving the house. Since the deck does not have a roof it is not considered a room and therefore should not require a mezuzah going into it. Only the house is required to have a mezuzah so shouldn't the mezuzah be on the right side going in?
The explanation that I was given is that many decks do not have full (or normal) access from the yard. Even if they do, the normal access is from the house. As a result, people put the mezuzah on the right in the direction that the normal access uses (going out).
The question is, what is the deck considered. An enclosed deck means that he deck does not have a way of of going from the deck to the yard. Thus, it is the equivalent of entering a room with only one door into the rest of the house. In that case, the mezuzah goes on the right going from the room that is mainly used (the house) to the room that cannot be used for anything else (the deck). An unenclosed deck or a deck with stairs into the yard, is the equivalent of a porch, which is treated as part of the outside. As a result, it is treated as coming into the house from the outside. Thus, the mezuzah should be on the right as you enter the house.
Of course each house is different and needs to be checked. We have some beams in the middle of a room (along the ceiling and on one side) that required a mezuzah (as an example).
I discussed it with my LOR this shabbos and he said that if the deck does not have a set of stairs to the yard, then he would hold that it should have the mezuzah on the right going out. He also said that there are rabbonim who hold that it goes on the right coming in in any case. He needs to discuss it with some others to determine a final psak. We also have a door to the shul that is normally locked and only opened with a safety bar from the inside. The door is at the bottom of a ramp to the basement so that handicapped people (who have the key to the door) can use the ramp rather than the stairs (on the inside). Since people do have the key and use it, then the mezuzah is set going in. The shul also has an emergency door that can be opened only from the inside. The rav wants to put the mezuzah going out, but is going to discuss it with others first. He says that he does not understand why people would say that it should be put as if it were an entrance, but is going to study the matter further.
Note that I put in what my rav says in order to show the logic behind what different people do. Obviously, I cannot expect others to blindly accept this.
I found a reference to a machlokes on the matter which cited She'arim Metzuyanim Ba'Halacha 11:3
Mezuzah.net found on a google search. Disclaimer I am not familiar with this site and am pointing to it only to show the logic being dicussed.