In an apartment, I might go with a shotgun - with #4 buckshot as a good manstopper, that still won't 'overpenetrate' modern particleboard wall construction. Shotguns really are the most unwieldy of weapons though, and I'd probably still default to a pistol were I surprised by a bump in the night. If I know the urban zombie/golden horde were definitely coming TO-NIGHT... then I'd have the shotgun at the ready.
In my three story house with a full basement, I go this route.
Upper was custom made by Addax, Inc, out of Los Angeles. 14.5" Sabre bbl with pinned/welded Phantom comp for legal length. 1:7 twist, chrome-lined bbl set in a Vltor MUR 1A upper. BCM lower has a Giselle SSA trigger. Insight Proxima HX120 sheds more light on the matter, for the Aimpoint T-1 to focus on. 69gr. Privi JHP's git 'r' done. If the urban zombies/golden horde comes down MY street, that's how I'll greet 'em.
I still tend to default to a 1911 for regular carry and home patrol work, though...