Apple interview question

Design a frequency counter circuit.