Gas Station problem
You know that old interview question "How many gas stations are there in the US?" You see if the person can guess within an order of magnitude or so and if he reasons like "Hm, there are 300 million people and probably 200 million drive and buy 1 tank a month and gas stations probably have 100 cars an hour for 12 hrs a day so..."
The problem with this is, if it is going to be a real development problem, it should be handled more realistically:
"How many? We only are looking for a very rough estimate."
"OK... blah blah blah, 50,000 of them."
"OK great. Now 6 months have passed. We invested considerable resources based on the project estimate you gave us of 50,000, but it turns out the real number is 100,000. We lost the contract, we are out of cash, and it is all your fault for giving this faulty estimate. You are fired!"
July 5th, 2007 3:39am
If it is going to be a real development problem, you don't guesstimate in fifteen minutes. You call the American Association of Gas Stations or whatever, and ask them for the numbers.
No, the parallel for being allowed to get on the phone and get the absolutely exact number would be to be allowed to expend whatever resources are necessary to create an absolutely accurate estimate, despite being told only a very rough estimate is needed.
July 5th, 2007 4:31am
>We lost the contract, we are out of cash, and it is all your fault for giving this faulty estimate
You are missing the point. The very essence of this question is to test your ability to reason logically, and how aware you are of general knowledge.
If you're basing your business on somebody's best guess instead of actually doing the research and getting the real statistics, then you're a fool.
July 5th, 2007 6:29am
My answer in the interview would be to call the American Petroleum Institute and just ask them.
Or spend some time looking through their site: api.org
July 5th, 2007 7:27am
I don't think that the gas station problems is a good one for weeding out applicants IF the interviewer is actually expecting an answer anywhere near the actual number.
There are too many variables: population density, varying rates of gasoline usage (i.e., "Sunday drivers"), etc.
As a purely logical exercise to determine the applicant's thought processes, sure, it's fine.
July 5th, 2007 7:54am
A couple that we had at McKinsey included
Estimate the weight of a 747
How many red ferraris were sold in the US last year?
You would be amazed at how close you can get to the right answer.
>"How many? We only are looking for a very rough estimate."
>"OK... blah blah blah, 50,000 of them."
>"OK great. Now 6 months have passed. We invested considerable resources based on the project estimate you gave us of 50,000, but it turns out the real number is 100,000. We lost the contract, we are out of cash, and it is all your fault for giving this faulty estimate. You are fired!"
Yep, been there, done that. I'm not thrilled about pulling numbers out of my ass for "ballpark estimate" as I've been burned in the past for it.
Hmm, a quick google gets in the ballpark of 120k gas stations.
Page 16 of http://www.census.gov/prod/ec02/ec0244a1us.pdf
shows that there were 121k back in 2002 (the reports took 3 years to release). The next economic census won't be done until the end of this year, and conveniently won't be released until after the next scheduled elections - which I don't think will actually happen.
Number of people employed & wages:
July 5th, 2007 9:50am
In response to the first question, and the response from the employer:
"Wow, sucks to be you. Maybe in the future you shouldn't bet your entire business on an off the cuff estimate as to the size of the problem you have to solve. Now I'd like to speak to your boss, because if this is an example of how you run your department I'm pretty sure you'll be working for me in six months."
"The very essence of this question is to test your ability to reason logically, and how aware you are of general knowledge."
Exactly, so that they can be confident you can reason similarly on the job, regarding estimates, where we all know that once you are forced to give a rough estimate, you will be required to hit that estimate as a hard target, after they have subtracted 50% of it since engineers are always padding out their schedules with fluff.
July 5th, 2007 10:36am
The correct response was: how many do you want there to be? And when given an answer to say "yes sir!"
son of parnas
July 5th, 2007 10:40am
"If you're basing your business on somebody's best guess instead of actually doing the research and getting the real statistics, then you're a fool."
I'm not sure if you didn't follow the insinuation here. In development, it's almost unheard of to be allowed to do the work necessary to come up with a proper estimate, and even when you do, the estimate is ignored in favor of business targets.
This is life for 99% of developers:
"How long will this large project take?"
"I can put together an estimate in a week."
"I don't need anything detailed, just something rough to decide if we can do this or not."
"Around 3 years, if you can get Joe and Susan and Mitch transferred to work on it with me."
"That's not possible. They are busy with other things and we need this working 100% for the trade show in March. Can you have it ready by then?"
"Not under those constraints."
"I believe in you. Now get cracking."
July 5th, 2007 10:41am
> Now get cracking.
LOL. And then you say "yes sir!" and watch as history rerepeats itself yet again.
son of parnas
July 5th, 2007 10:46am
"I don't think that the gas station problems is a good one for weeding out applicants IF the interviewer is actually expecting an answer anywhere near the actual number."
Most people will say "I have no idea" and stick to that. People good at rough estimates can get a rough estimate within a factor of 10 by thinking in a rough way. This is exactly the same sort of think that we have to do all the time as developers. A correct estimate within 10% on a project is VERY difficult to do and there are people who study how to do that for decades and use complicated mathematical models. The whole thing requires CMM5 type documentation of past project metrics and so forth. Companies don't want to spend that effort and say that they just need a rough estimate. But once you state a rough estimate, they will hold you to it as a fixed estimate, no matter how much you say it is rough. And if they don't like the estimate, they replace it with their preferred business target instead, then refuse to allocate the resources necessary to meet that target, or to even determine if it is possible under any given resources.
What I am saying is that if they ask these estimate problems in the interview, they should let the whole thing be accurate and not just the first step where you are tricked into giving a 'rough estimate' as part of their 'negotiating with the engineers' stage.
July 5th, 2007 10:47am
BTW, 50k above was my wild assed guess without even doing the math.
The actual number of gas stations for 1997 is 45,205.
But there were also 81,684 convenience stories that sell gas.
Including everything that sells gas, including truck stops and whatever, the 2000 number is 195,455.
July 5th, 2007 10:55am
July 5th, 2007 11:05am
They are not testing your ability to estimate.
They are testing your ability to reason, and follow through a train of logic. aka the ability to think through a problem, and not just regurgitate answers you have read somewhere.
Hence the pointless questions that could be accurately answered after 5 minutes on Google.
"How many red ferraris were sold in the US last year?"
I'm guessing 500.
Google follow up shows that Ferrari caps total sales in the US at around 4200.
Probably 1/2 of them are red, 1/3 black.
So actual number around 2100.
July 5th, 2007 11:09am
"They are not testing your ability to estimate."
You are incorrect.
"They are testing your ability to reason, and follow through a train of logic."
How do you think you do an estimate?
July 5th, 2007 11:09am
Anyway, this is not about the damn question and its correct answer. This is about bringing realism to the question. If asking for a seat of the pants estimate on the spot, follow it through with what always happens NEXT, which is that you just got suckered into providing a fixed estimate and swore or your mother's grave you will deliver according to that estimate, at least that's how management remembers the conversation.
July 5th, 2007 11:11am
> How do you think you do an estimate?
I would go:
1. The number of people owning a car in the US probably about 1,000,000 people.
2. They have two cars per person.
3. I don't know, we probably need a gas station for 1 out of 10 people.
That make for 200,000 gas stations. Which is probably wrong. But I usually am.
son of parnas
July 5th, 2007 11:13am
I don't know what US you live in, but in mine substantially more than 1 million own a car.
1 - I have never even seen a Ferarri in person
2 - I have never seen a dealership
3 - I have no idea how many dealerships sell them
4 - I have no idea how many Ferarris there are
5 - I have no idea what proportion are red
6 - If I can use reference material, I'd just fucking call them and find out
So I'm essentially guessing, pulling numbers out of my ass.
Oh, but I could make an estimate within a factor of 10. That's not at all useless, no sir. If I guess 2000 that's good for anything from 200 to 20,000.
July 5th, 2007 3:59pm
The Ferrari symbol is a 'dancing' Stallion (I guess they call it "rampant"). Note the Porshe medallion also has a stallion on it, but the Ferrari symbol is JUST the Stallion.
In college, once, I saw this beautiful sleek red car. It had a dancing stallian medallion on it, and told the guy standing by it, "I really like your Porshe", never having seen a Ferrari before.
"It's a FERRARI", he said, with GREAT disdain. I slunk off in humiliation to drive away in my Honda Civic.
July 5th, 2007 4:08pm
Golden. I could have done that.
July 5th, 2007 4:33pm
> but in mine substantially more than 1 million own a car.
Whoops, I meant 100 million. See what a crappy guesser I am?
son of parnas
July 5th, 2007 5:03pm
i would have gone the other way to estimate....
from the gas bars i've seen, they number between 6 and 20+ pumps with the average probably around 12.
also, from what i've seen, they seem to be at an average of 30% capacity, so around 3.5. but i'm guessing the night time shift is slow, so the average is probably closer to around 15%.
each fill up takes about 3 minutes. so a station with 1.8 (12 x 15%) pumps running for 24 hours handles about 1.8 x 20 x 24 = 864 fill ups.
divide the population of the US by 864 = 347K stations...
the correct answer is 120K:
July 5th, 2007 5:49pm