Where should smoke detectors be located?
According to the guide handed out by my local permitting office, which doesn't cite electrical or fire codes but does detail what they look for: 

A smoke detector should be placed inside the door of each bedroom 24 inches from the nearest walls or centered on the doorway 24 inches from the wall holding the door. 

A combination smoke alarm / carbon monoxide detector should be placed in any hallway that leads to bedrooms, where it enters the main part of the house, again, centered in the hallway on the ceiling and 24 inches from where the hallway connects to the rest of the house. 

All of the smoke detectors should be hardwired to a circuit on the house's mains and should talk to one another via a third wire.