In the world of D&D, non-magical protections only are not enough to protect people and secrets in an important building such as castle or house of parliament. Intruders and spies may use magical spells and items such as invisibility, scrying, teleporting, etc.
Assuming that is a castle or similar facility of a small city, what kind of magical warding should be typically used?
You are correct.
Defenses against magical activity will be layered. The exact details depend on what you want to use in your campaign.
Non-magical Defenses:
Dogs - Creatures with the scent ability will 'watch' major entrances and be trained to respond to odors with no apparent source.
'Airlocks' - Corridors will regularly be broken by pairs of guarded doors.
Curtains - Curtains either of beads or cloth, sometimes with attached bells, cannot be easily traversed without setting them off. This allows a guard to observe an approaching invisible creature.
Lead Paneled Walls - In most versions of D&D, lead blocks attempts to scry through it. Important meeting rooms will have panels of lead and lead nails affixed to the walls underneath the visible wood or leather paneling.
Blood Mortared Concrete/Bricks - In some versions of D&D, blood or other potent living or once living ingredients block ethereal travel. If this is the case, important areas will be constructed with this defense. Of course, as a DM you are free to invent building materials with magical properties - exotic woods, exotic magical stones, imports from the outer planes gifted to rulers by extraplanar beings, etc.
Standard Magical Defenses
Alarms - Windows or other access points not meant for entry will have permanent alarm spells. These are not likely to be put in corridors, as corridors are meant to be traversed.
Magic Mouths - Magic mouths can give audible alarms when certain conditions are meet, such as shouting, "Foes! Foes in the North Corridor!" whenever someone passes an area with a drawn blade.
Glyph of Protection - Important access points can be secured with passwords which must be used, or powerful spells can be triggered.
Permanent Circles of Protection - Beds, thrones, and other places where a ruler is likely to spend a large amount of time defenseless or exposed will have inscribed circles of protection permanently enchanted around them, to prevent possession, enchantment, or attack by summoned or conjured creatures.
Permanent Dimension Locks - Likewise, bedchambers, garderobes, wardrobes, staterooms and so forth are likely to be enchanted so that you can't teleport in or out of them.
Also, the ones you thought of.
Improved Magical Defenses
Sticking to the SRD, doors and rooms can be enchanted as custom magical items with virtually any effect desired. This however is expensive. I prefer that my societies will develop cheaper alternatives in the form of permanent spells with lower costs in GP/XP. Some ideas:
Improved Magic Mouth: Permanent with a cost in line with continual flame or similar spells, and can be enhanced to include one standard sensory spell, such as 'detect undead' or 'detect invisible creatures' or 'detect illusions' or 'detect shapechangers'. These are used at important choke points such as gate houses, entrances to great halls, and entrances to the rulers chambers.
Improved Arcane Lock: As Arcane Lock but can be given a programmable bypass (opens if you say a password, if you wear or carry a certain device, etc.). There are likely to be panic rooms or safe rooms for the family that only open to those carrying a household crest or similar device.
Ward of Strength: Permanent and increases an objects hardness and hit points. Doors, window glass, and even whole walls are likely to be so treated in the ruler's inner sanctum. The exterior gates are also likely to be so treated.
Anti-Magic Screen: Provides a small transparent, insubstantial surface through which spells cannot be successfully targeted. Useful for placing over windows or arrow loops.
Ward Against Magic: Permanent and provides spell resistance to an object.
Ward Against Fire: Permanent and gives an object or area fire resistance and improved saving throws versus fire based attacks. Particularly common in libraries or studies or anywhere valuable inflammable items are kept.
In my campaign, these sorts of spells and others are ubiquitous in any building that has been around more than a century or so.
Actually, beyond that, in my campaign any building that has been inhabited for a century or so tends to spontaneously create or attract one or more household spirits, which adds an additional line of defense - in some cases a quite powerful one depending on the age, stature, and heritage of the building. To say nothing of the brownie that lives in the attic, a really powerful house hold spirit can use spells like bless, protection from evil, sanctuary and heroism to actively protect whomever it sees as the legitimate owner of the house, as well as actively use spells like hold portal or animate object on itself and if necessary even manifest and verbally warn its owners. So even a humble wooden cottage, if it has been continually occupied and maintained and loved by the same family of peasant farmers for 4 centuries, can become something of a fortress.