Amazon Interview Question

Stack-based, sets and hashmap based and one design