Apple Interview Question

Design a frequency counter circuit.