FamPay interview question

Design stack and queue, there is similar question on leetcode