New ask Hacker News story: How do you guys come up with such an algorithm

How do you guys come up with such an algorithm
2 by Handsome2734 | 4 comments on Hacker News.
I was on an Apple QA interview yesterday, and I was asked to design a stack, which can do push and pop, and should have O(1) complexity to find the minimum value. I couldn't solve the problem, so after the interview, I looked up Google and found this: https://ift.tt/fj1UQqw I wonder how you come up with such a solution when given the problem. It seems just incredible.

Comments

Popular posts from this blog

New ask Hacker News story: Tell HN: Equifax free credit report dark patterns

New ask Hacker News story: Ask HN: Why can't the US government run their own social media?