Amazon Interview Question

Two programming tests, randomly determined.