Work in HR or Recruiting?
Amazon.com
www.amazon.com Seattle, WA 5000+ Employees
Work in HR? Complete Your Profile

201 interview experiences Back to all Amazon.com Interview Questions & Reviews

Interview Question for Software Engineer at Amazon.com:
May 9, 2012

implement queue with two stacks


Add Tags [?]

See more for this Amazon.com Software Engineer Interview

Helpful Question?  
Yes | No
Inappropriate?

Answers & Comments (1)

May 18, 2012

by Pavel:

Maintain the queue in stack1 in reversed order. If you want to retrieve the head pop the contents of stack1 into stack2, reversing it in the process. Now pop the head from stack2 and pop the rest of the items back into stack1, putting them in previous order.
Helpful Answer?  
Yes | No
Inappropriate?

To comment on this question, Sign In with Facebook or Sign Up

Amazon.com – Why Work for Us?

At Amazon, we believe that everyone is a leader—it's part of what makes us 100% Peculiar. Whether you are a Software Development Engineer, Product Manager, Fulfillment Associate, or Customer Service Representative, you… Full Overview

Provided by employer [?]

Tags are like keywords that help categorize interview questions that have something in common.