We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Just so you interviewers know, this is a terrible, terrible interview question. If they know it's stupid to implement it this way, leave it at that and move on to the next question. There are MUCH better ways to see if a candidate understands queues and stacks than trying to trick them with a trick question like this.
Having said that, this is an interesting problem with a clever solution. Just don't use it on interviews unless you want to see how many useless problems they've solved on hacker rank
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Queues: A Tale of Two Stacks
You are viewing a single comment's thread. Return to all comments →
Just so you interviewers know, this is a terrible, terrible interview question. If they know it's stupid to implement it this way, leave it at that and move on to the next question. There are MUCH better ways to see if a candidate understands queues and stacks than trying to trick them with a trick question like this. Having said that, this is an interesting problem with a clever solution. Just don't use it on interviews unless you want to see how many useless problems they've solved on hacker rank