Amazon Interview Question

some from here, some from distributed computing