Quant Memo
Coding/●●●●●

Build an order intake queue from two stacks

Orders must be processed strictly in arrival order (first-in-first-out). Using only two stacks (each supporting push and pop from the top), implement a queue with enqueue, dequeue, and peek.

enqueue 1, enqueue 2, enqueue 3
dequeue -> 1
dequeue -> 2

Implement a FIFO queue backed by two LIFO stacks, with amortized O(1) operations.

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions