Fully automatic shotgun. Regular shotgun has too low rate of fire and small clip or no clip at all, so you'd be dead the moment a horde comes at you. Too slow, too clumsy.
SMG or assault rifle with at least 30 ammo clip would be even better if the zombies are the slow kind, you can pull headshots quickly or there's enough room between you and the zombies.
The trick is to use semi-automatic fire and aim for the head instead of emptying your clip into a zombie torso, like everyone does in the movies...
Sniper rifle on the other hand is only good for having some target practice from your roof.