Amazon Interview Question

Mostly from Data Structures and Algorithms