I interviewed at Google, here are the GOOGLE INTERVIEW QUESTIONS!

Page 6 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

SagaLore

Elite Member
Dec 18, 2001
24,036
21
81
Originally posted by: ronin2kr6
Ironic if someone could have googled the answers before hand

Every answer I would give would be "I don't know, but I will google for it."
 

tami

Lifer
Nov 14, 2004
11,588
3
81
Originally posted by: shilala
If they asked me those questions I'd have to give them a dazed look and a spin-kick to the head.
Then I'd ask if I could have the office in the bathroom.

fixed.
 

Alex

Diamond Member
Oct 26, 1999
6,995
0
0
whoa thats pretty hardcore! :)

i read the first few and gave up! i'm sure once i finish my computer science degree i'll have a better idea of how to tackle these but for now one word: intimidating! :p
 

Train

Lifer
Jun 22, 2000
13,587
82
91
www.bing.com
you think 55 Hour work week is a bad thing? bwuahahaha

Don't talk to me until you've been knee deep in code for 80 hours a week for 6 weeks straight in the middle of the summer to get a project done on time. If you want to be a programmer, be prepared for times when your life will suck really bad and you will fry your brain for weeks on end.
 

Beattie

Golden Member
Sep 6, 2001
1,774
0
0
Originally posted by: statik213
Question #6) Given a square with side length = 1, describe all points inside square that are closer to the center of the square than to the edge of the square.
Why is everyone overthinking this question?
Isn't it simply all the points within the square with side lenght 1/2 centered at the same point as the bigger square?

Short answer, no.

Long answer, Do the math.

Simple explanation. Think of a corner of the small square. Lets say the upper right one. It would be how far from the side of the larger square? 1/4. how far is that point from the center? well, it's the hypotenuse of the triangle formed by lines from the center straight to that right edge, and the line from then center of that right edge to the upper right corner. The hypotenuse of a triangle with sides equal 1/4 is going to be longer than 1/4, right?
 

puffff

Platinum Member
Jun 25, 2004
2,374
0
0
i attended the CMU CS program (and managed to graduate). i actually understand the questions, and i think if i were presented them while in school, i could answer a few, but its been 3 years since i've attempted anything like it.. so yeah... i give up
 

DrPizza

Administrator Elite Member Goat Whisperer
Mar 5, 2001
49,601
167
111
www.slatebrookfarm.com
I posted this in Highly Technical as well:

Something smells fishy...

ones3k keeps bumping this thread.
Over a week ago, he asked the same question in highly technical as question #1
People immediately suspected it was a request for homework help. He never responded to that accusation.
Now, that same question has been posed, along with other questions, along with the source of the questions: a Google interview.

Anyone think it's odd he didn't mention the interview a week ago?
Nor has he posted a complete correct solution to any of the problems.
Furthermore, he's asked that we post complete solutions for any of the problems for everyone else to see.

ones3k, maybe you're being honest about this, and if so, I apologize.
However, I still smell a plea for homework help.
 

Baked

Lifer
Dec 28, 2004
36,052
17
81
Maybe they pay by the high 6 figures salary, buy you a house and car, and throw in a pair of twins (you get to choose the race).
 

sygyzy

Lifer
Oct 21, 2000
14,001
4
76
Have not read replies. Gas station question is an infamous Microsoft interview question. It's the same one I ask people that I interview. I have never had anyone even attempt to answer it. Most of them just laugh and ask if I am serious. The rest just throw out a number "uh 2000?". The point of MS questions is to see how you think.

Here is the answer, if you are interested. Of course there is a real exact answer but nobody is interested in that.

There are 350M people in the United States. Probably half are either children (minors) or senior citizens that can't drive. So now we have about 175M people. We can reduce that a bit further in case there are peopole who carpool, bike, etc. 150M is nice and round.

Most people fill up once every 10 days. That's 3 times a month. Each gas station has on average 6 pumps (personal observation). If it takes 4 minutes to fill up, in one hour a single gas station can service 90 cars per hour (60 mins / 4 mins per car = 15 cars per pump per hour x 6 pumps = 90 cars). Most stations are open 8 hours a day (though there are some that are 24 hours, but of course they service a lot less during off hours. The numbers even out if 15 cars per hour seems high to you). So in a day, a station can service 720 cars.

There have to be at least as many stations as is demand. 150M cars filling up 3 times a month is 450M worth of fillups. In a day a single station can service 720 cars. 720 cars x 30 days is 2160 cars a month per station. 450M fillups / 2160 fillups per station = 208,333 stations.

You can of course modify this as you see fit. You can even do the math in your head by choosing easier numbers. And it could just be an estimated answer (not precise). All are acceptable. But like I said, not a single person ever even *tried* to answer it for me.
 

Train

Lifer
Jun 22, 2000
13,587
82
91
www.bing.com
I guessed 1 fill up per week, each station doing 160 fillups a day (5 people per half hour * 8 hours of operation)

then I guessed 150 million people driving (about half the US population)

so that works out to about 270,000 stations

I really cant believe no one attemtped to answer that, I was already estimating it in my head as soon as i read it. I would have asked for a calculator so i could punch in all my guestimates and give you an answer.
 

TXHokie

Platinum Member
Nov 16, 1999
2,558
176
106
Would I have gotten a brownie point if I had asked for Microsoft Excel to solve this?

These question remind me of my one interview at NASA. The guy tossed me three question, one of which was:
You're in a car going up a ramp turning to the left, inside the car you have a helium baloon. Which direction does the baloon swing to in the car (if it does) and why?
Needless to say I didn't get the job .. and I was glad I was nowhere near control center when the space shuttle went down or I would have been blamed.
 

DrPizza

Administrator Elite Member Goat Whisperer
Mar 5, 2001
49,601
167
111
www.slatebrookfarm.com
help for problem #6:

a parabola is the locus of points equidistant from a fixed point (focus) and a directrix (line).
The center serves as the focus, and the edges serve as the lines.
You have the intersection of 4 parabolas.
Choice of rectangular or polar coordinate system for writing the equation(s)
 

ones3k

Banned
Aug 21, 2005
444
0
0
Originally posted by: DrPizza
I posted this in Highly Technical as well:

Something smells fishy...

ones3k keeps bumping this thread.
Over a week ago, he asked the same question in highly technical as question #1
People immediately suspected it was a request for homework help. He never responded to that accusation.
Now, that same question has been posed, along with other questions, along with the source of the questions: a Google interview.

Anyone think it's odd he didn't mention the interview a week ago?
Nor has he posted a complete correct solution to any of the problems.
Furthermore, he's asked that we post complete solutions for any of the problems for everyone else to see.

ones3k, maybe you're being honest about this, and if so, I apologize.
However, I still smell a plea for homework help.

I'll post the solution to #1:

here it goes:

My solution is to create a binary tree with each leaf representing a stream. We construct the tree from the leaves up. Each node in the tree will contain an integer.

First we insert all K leaves and their corresponding integers (which will be the current element in each stream). From here we construct a "tournament" tree by pairing up nodes at each level and taking the smallest. At the root of the tree we will have the smallest item. Before we move on, please draw this incase im being confusing.

Next, notice that the smallest item (root), must of been compared against the second smallest.

So we increment the stream corresponding to our winning element and update our tree by pushing the new element through the same path as the old element. This is a log(k) operation and we are guaranteed to get the smallest every time because the smallest element beat the second smallest.

so its O(k) to set up the tree and access the first element and O(log(k)) for each stream access thereafter
 

ones3k

Banned
Aug 21, 2005
444
0
0
I estimated the gas station geographically, and arrived at an average of 5000 per state * 50 states = 250,000 gas stations. Pretty close for almost no math invloved.
 

SLU MD

Senior member
Aug 14, 2003
471
0
0
These guys easily work 55hours a week.

At least theres still Microsoft...


that would be a godsend from my 80 hour weeks i'm putting in now (man i love surgery).

Dont work 60+ hrs, dont complain when your pay isnt as high as you would like.

 

JayHu

Senior member
Mar 19, 2001
412
0
0
Originally posted by: ones3k
Originally posted by: DrPizza
I posted this in Highly Technical as well:

Something smells fishy...

ones3k keeps bumping this thread.
Over a week ago, he asked the same question in highly technical as question #1
People immediately suspected it was a request for homework help. He never responded to that accusation.
Now, that same question has been posed, along with other questions, along with the source of the questions: a Google interview.

Anyone think it's odd he didn't mention the interview a week ago?
Nor has he posted a complete correct solution to any of the problems.
Furthermore, he's asked that we post complete solutions for any of the problems for everyone else to see.

ones3k, maybe you're being honest about this, and if so, I apologize.
However, I still smell a plea for homework help.

I'll post the solution to #1:

here it goes:

My solution is to create a binary tree with each leaf representing a stream. We construct the tree from the leaves up. Each node in the tree will contain an integer.

First we insert all K leaves and their corresponding integers (which will be the current element in each stream). From here we construct a "tournament" tree by pairing up nodes at each level and taking the smallest. At the root of the tree we will have the smallest item. Before we move on, please draw this incase im being confusing.

Next, notice that the smallest item (root), must of been compared against the second smallest.

So we increment the stream corresponding to our winning element and update our tree by pushing the new element through the same path as the old element. This is a log(k) operation and we are guaranteed to get the smallest every time because the smallest element beat the second smallest.

so its O(k) to set up the tree and access the first element and O(log(k)) for each stream access thereafter


The structure you're describing is similar to a binary heap.
Except data is stored at all nodes, not just at the leaves. This could be what you're actually thinking of, but your description is less than perfect.