Does a walk in closet need a Mezuzah?
This follows the same ruling as any other room and is determined by its size. If the closet is less than 4×4 but is spacious enough to walk inside of, then it is subject to the dispute regarding if and where a Mezuzah is to be placed in a room of less than 4×4 in size. Practically, if one has s swaying door one is to follow Heker Tzir. If one does not have a sawing door one is to place the Mezuzah on the right side from the direction of exiting the closet into the room. If this is the master bedroom, care must be taken to cover the Mezuzah with a non-transparent casing. If the closet is not spacious enough for people to enter then it does not require a Mezuzah.
Does a hanging closet need a Mezuzah?
If the closet is not spacious enough for people to enter then it does not require a Mezuzah. If it is spacious enough for people to enter, it requires a Mezuzah as stated in the previous Q&A!
 See Minchas Yitzchak 3/104 that implies only if one cannot walk inside is it exempt from a Mezuzah, See also Beir Moshe 2/93 [if less than 4×4 exempt-but that was referring to a boxed form walk in closet]; Pischeiy Shearim 286/157 and 162 that custom is to place Mezuzah on walk in closet, facing into the room
 Minchas Yitzchak 3/104; Beir Moshe 2/93; Pischeiy Shearim 286/157 and 162; Kevias Mezuzah Kehilchasa 2/2