Development Interview Questions

137,190 development interview questions shared by candidates

The numbers 1-5 are inserted, in order, into a stack. Numbers are removed from the stack one-by-one and pushed into another array (numbers could be removed at any time, even before all the numbers have been added to the stack). What order of numbers in the array could NOT be produced by this scenario? Write code to determine if a sequence of numbers could have been produced by this scenario.
avatar

Software Development Engineer

Interviewed at Microsoft

4
Mar 8, 2016

The numbers 1-5 are inserted, in order, into a stack. Numbers are removed from the stack one-by-one and pushed into another array (numbers could be removed at any time, even before all the numbers have been added to the stack). What order of numbers in the array could NOT be produced by this scenario? Write code to determine if a sequence of numbers could have been produced by this scenario.

Viewing 221 - 230 interview questions

Glassdoor has 137,190 interview questions and reports from Development interviews. Prepare for your interview. Get hired. Love your job.