Frage im Vorstellungsgespräch bei Qualcomm

Implement queue using two stack. How to design a system to avoid deadlock.