If you get asked a question like this in an interview, remember that they are NOT looking for the RIGHT answer. You will be
evaluated on the approach you use to solve the problem. A strong candidate
demonstrates the following:
Strong Answer
Let’s assume Manhattan is 100 blocks long and 10 blocks
wide, so there are 1000 square blocks in the city. If in each square block
there are 5 lamps on each side of the street, 20 total in each square block, then the total number
of street lamps would be 20 lamps for each square block times 1000 square
blocks, or 20,000 street lamps.
Commentary
This is a very straightforward question and variations of this are common (how many cups of Starbucks coffee are consumed in a given day in the U.S.? How many red cars might you find in the city of Los Angeles?). The interviewer wants to see if you can quickly and easily identify the key assumptions or variables and do some fairly simple math on the fly.
In the weak answer, the candidate makes a few assumptions
and explains his/her calculation, but has mistakenly narrowed the scope too much,
forgetting that there are streets which intersect the 100 blocks. As a result,
the interviewee is significantly underestimating the likely number of street
lamps.
In the strong answer, the interviewee makes assumptions,
recognizing the length and width of Manhattan. He uses numbers that are
reasonable and that simplify the math, and talks the interviewer through the
calculations. If any assumptions are off, the interviewer can easily make corrections.
For the purposes of this advice, I've provided a relatively simple riddle. Typically they are more complex. It's important to ask clarifying questions and talk the interviewer through the assumptions you are making so that they can give you additional information as needed.
Some major tech companies such as Microsoft and Google routinely
incorporate riddles or logic questions into their interviews, but these typically
have correct answers they expect you to derive. If you love riddles, want to practice more of the quantitative riddles you might get in a tech interview, check out
wu : riddles , a forum maintained by a Stanford PhD.