Work in HR? Unlock Free Profile

Symantec Mobile Software Engineer Interview Question

I interviewed in San Francisco, CA and was asked:
"Design a stack implementation that has "push", "pop" and "peek" functions (look at the top-most value of the stack without popping it off the stack), and then design a function that tells the caller what the "minimum" value in the stack will be."
Tags: analytical
Add Tags [?]

Part of a Mobile Software Engineer Interview Review - one of 322 Symantec Interview Reviews

Answers & Comments

of 0
Turns out this is a trickier problem than it looks. Sure, it's easy to design a stack that does push, pop and peek, but the "minimum" function needs to keep track of the minimum values of the stack in order (i.e. if a "1" gets popped off the stack, "minimum" must then return the next minimum even if it's deep down within the stack). In my case, I would have come up with a linked list of minimums.
- Interview Candidate on Jan 29, 2013

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

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