Shopee Interview Question

Q: construct a 2-way queue and output the operation behavior.