Dow Interview Question

How does a thermostat work?