How would you implement a Queue class from scratch, including handling edge cases like boundary conditions?