Wednesday, January 30, 2013

Interview: How many quarters would you need to reach the height of the Empire State building?

How many quarters would you need to reach the height of the Empire State building?


Below are 4 different ways that I could answer the question. The third one is the standard answer you'll hear from most people. The others are just my way of being different... although they may have already been thought by other people but I didn't find any (not that I spent a lot of time trying).

1. Assuming you start at the base of the Empire State building and knowing that the tallest building is around half a mile in height, the cheapest way to reach the height of the building would be to hike up a mountain. I don't know where the closest mountain is, flights are rather cheap. All flights will reach the needed height, thus the cheapest flight will do. Flight can be as low as $79, so $100 would be a safe guarantee for a flight. Thus it would take 429 quarters, including $5 for the airtrain to JFK and subway ($2.25).
2. If you had to return back to the base, then a helicopter tour would be cheaper at $150. Thus 600, maybe 618 if you take the subway.
3. If assuming stacking quarters as most people would assume it is asking, then you'll need the height of the building and the thickness of quarters to determine the "minimum" number of quarters you will need. Empire is not the tallest so I'd take a wild guess that it is about a third of a mile, thus around 1500 feet. Thickness of a quarter is maybe a sixteenth of an inch. 4 quarters is about a quarter inch, so seems reasonable. Since we're estimating let's use 15 (because it seems like it would be a nice round number for 1500). 1500 feet = 18000 inches. 18k * 15 quarters / inch = 270,000 quarters.
4. Given that I cannot even stack quarters beyond a foot, you'll probably need a pyramid worth of quarters. Equation for a cone is (pi) * r ^ 2 *h / 3. 45 degrees is a safe angle to stack quarters without them shifting, so r will the same as h. (3.14159 * 18k ^ 3) / 3 ~ (20k ^ 3) = 8 * 10 ^ 12 in^3. Volume of a quarter is a (pi) r^2 * h. Quarter is about an inch wide, (3 * 1^2 * 1/16) = 3/16 ~ 1/4 in^3. So it would take apprximately 32 * 10^12 quarters to reach the height of the empire state building.
5. Add the cost of all the labor to complete #4.

One answer provided online is 263,000 quarters. My third number is not far from that value. I still think the fourth one is most reasonable, although I think the first and second are funnier.

Other notes: Elevator available to the public doesn't take you all the way to the top. There is an argument whether antennas should be included in the height of a build. Asking what/which quarter implies you can ask the height of the empire state building, thus that would not be a good question (but it may not hurt to ask).

Reference:
~ - approximately for easier calcuations
Question - http://www.techrepublic.com/blog/career/glassdoors-top-25-oddball-interview-questions-for-2013/4783
Anwer - http://answers.yahoo.com/question/index?qid=20070523180130AA8ll3C

http://en.wikipedia.org/wiki/Empire_State_Building
  Height of Empire State Building (roof) = 1250 feet = 381.0 meters = 102 floors
  Height of the tip of ESB = 1454 feet = 443.2 meters

Tuesday, January 29, 2013

Interview: Have you ever stolen a pen from work?

Have you ever stolen a pen from work?

Just some fun thoughts that I wouldn't recommend using:
  1. No. People either steal more than one pen or they do not steal at all. Who steals just one pen?
  2. No. I've always been expected to work from home / remotely / always on-call.
  3. No. Who uses a pen anymore? / Do you mean a stylus?
  4. Did the company expense all items I buy for work?
  5. Has the owner / CEO / President exploited company expenses / taxes for personal purchases?
  6. How many TD Bank pens do you think your company has?
I would avoid saying yes / no:
  1. I have plenty of pens at home thus I have no intentions to steal any pens.
  2. I may have accidentally brought one home, but usually it also accidentally returns back to the office because I didn't realize that I accidentally brought it home.
  3. I bring pens to work.
In reality, I typically bring my own pens to work because they are better than the cheap company pens. Decent gel pens have a nice consistency and less hassle than the ordinary ball-point pens. Avoid bad/cheap gel pens because they can cause a lot of smudges if the point breaks.


 Off topic - I see the green TD Bank pens all over the place, and I will admit that they work very well except a little too big for my taste. Very off topic - I missed a chance to get a free TD Bank umbrella. Those looked pretty awesome.














Reference:
http://www.techrepublic.com/blog/career/glassdoors-top-25-oddball-interview-questions-for-2013/4783

Monday, January 28, 2013

Interview: Calculate the angle of analog clock

Calculate the angle of two clock pointers when time is 11:50


Continuing with some of the questions from Glassdoor's top 25 oddball questions... I am skipping around to whichever I find interesting. A couple of them are pretty common and already have rather standard answers. So, I picked this one because this turned out to have an extra step than what I originally thought.

Humor
Before I get to the common response, try one of the following if you're feeling lucky (disclaimer: make sure interviewer has the proper sense of humor)... the angle is the difference between meeting a deadline and getting fired... 0 degrees because it takes you 10 minutes to solve it... 90 or 180 on a digital clock... null, pointers have no direction in [programming language].

My Thought Process
At first glance, I thought the answer was 60 degrees because 11:50 is 10 minutes before noon/midnight. 10 minutes of 60 minutes in an hour = 1/6. Clock is 360 degrees, so 60 degrees. Then made a sanity check by trying to picture the clock at 11:50.

I quickly realized that the hour hand would not exactly be at the o'clock position. The hour hand would be slightly before the 0 degree (assuming o'clock is my reference). Each hour move 30 degrees (because each hour is the distance as 5 minutes which is half of 10 minutes). Thus for each minute, the hour hand would move 1/60 of 30 degrees, 0.5 degree.

The answer would be 60 degrees - 0.5 degrees * 10 minutes. Final answer is 55 degrees.

Additional Follow Up
A good potential follow up to this may be to provide the general equation (ie function, method, etc.) to generate the value for any time. Given X minutes and Y hours with noon as the 0 degree reference, the minutes degree will be X / 60 * 360 = X * 6 and hours degree will be X / 2 + 30 * Y. Thus, the final equation is |X * 6 - (X / 2 + 30 * Y)|. Test with original points, |50 * 6 - (50 / 2 + 30 * 11)| = |300 - (25 + 330)| = |-55| = 55. Test with 12:10, |10*6 - (10 / 2 + 30 * 0)| = |60 - (5 + 0)| = 55. Simplify the equation, | X * 5.5 + Y * 30|.

Add constraints... 0 <= Y < 24 and 0 <= X < 60. Y must be an integer; X must be a real number. If Y >= 12, then Y = Y - 12.

Some extra thoughts... If a graphic artist, then provide a time entry GUI. If animator, provide equation for reference to 3D space (ie angle if clock is angled at certain positions). If math, provide equation if only provided the positions of the two lines. If high school degree, use approximation because you should know that 3 and 9 are right angles so 90 degrees, so 10 (i.e. 50 minutes) and 11 breaks the 90 degrees into thirds, thus each hour is 30 degrees which gives you 60 degrees minus a few degrees. If physics, then ask about the velocity the clock is traveling at.

30 Degrees?


Guesstimation

Assuming you have figured there are 30 degrees between each hour, you can see that the answer must be greater than 30 degrees. From looking at the image above, you can see that the answer should be closer to 60 degrees. You will also notice that the hour hand is not exactly at the 12 mark. Therefore, the answer is less than 60 degrees. Mathematically, you should be able to estimate that the answer is between 30 and 60 degrees. If you eye ball the difference, you should be around 50-55 because 45 degrees would be symmetrically in the middle.

Misconception

I found that 30 degrees was a common answer to this question. This primarily comes because the image is of the hour hand on the 11 mark and the minute hand on the 10 mark. What is not considered is that the hour hand moved past the 11 mark due to the minute hand moving to the 10 mark.

Fortunately for me, my thought process was going from noon and going back 10 minutes. So I naturally picked up that the position of the hour hand was impacted by the minute hand. This is why I typically do a sanity check particularly with questions that appear simple but you get an uneasy feeling there is something amiss. For example, why would they be asking a simple geometric question in an interview? Or in this example, why would this be a top 25 list of oddball questions if the answer is so direct?

Reference

http://www.techrepublic.com/blog/career/glassdoors-top-25-oddball-interview-questions-for-2013/4783

Updated 1/24/2014 - Added section for 30 degrees to explain how the answer is not 30 degrees.