Amazon Interview Question

Just normal algorithms, time and space restrictions, etc.