Amazon Interview Question

Explain an algorithm of your choice