Amazon Interview Question

Started with basic java and sql