Object-Oriented Programming · Amazon · Medium
Build a queue that supports enqueue and dequeue, where each of these operations must complete in $$O(1)$$ time. You may not rely on any built-in data structures provided by the language. The queue has to be constructed by hand out of linked nodes, using loops where iteration is needed. Follow-ups Add a delete(x) operation. Add a removeAllDuplicates() operation. Interview Notes This came up in a new-grad low-level design (LLD) round in Vancouver, which was paired with a GenAI…