Carpmaels & Ransford interview question

How does a generator work?