Carpmaels & Ransford Interview Question

How does an electrical generator work?