A half is a third of it. What is it?
When was the last year that looked the same upside down? (1961)
A book costs $1 plus half its price. How much does it cost?
Question: You have two identical eggs. Standing in front of a 100 floor building, you wonder what is the maximum number of floors from which the egg can be dropped without breaking it. What is the minimum number of tries needed to find out the solution?
Suppose you had a Stack class. Write a new class MaxStack which, in addition to push() and pop(), has a method getMax() which returns the largest item in the stack. Use your existing Stack class to store the stack’s contents. Don’t just use pop() to “dig” through your stack to find the max—do something that… Read More »
How can you get a fair coin toss if someone hands you a coin that is weighted to come up heads more often than tails?
We are NY Tech asks: “How many unique areas of human knowledge have the right size of passionate users to make it as a Stack Exchange site?” Answer: 30,000.
What is the most efficient way, memory-wise, to store 1 million phone numbers? Apparently this is an interview question at Google, although this seems like its a bit too easy.
A typical programming interview question is “reverse a string, in place”. if you understand pointers, the solution is simple. even if you don’t, it can be accomplished using array indices. i usually ask candidates this question first, so they get the algorithm in their head. then i play dirty by asking them to reverse the… Read More »
Problem: you have 100 doors in a row that are all initially closed. you make 100 passes by the doors starting with the first door every time. the first time through you visit every door and toggle the door (if the door is closed, you open it, if its open, you close it). the second… Read More »