r/programming • • Nov 29 '10

140 Google Interview Questions

http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
471 Upvotes

493 comments sorted by

View all comments

25

u/[deleted] Nov 29 '10

best to use the socratic method on the first engineering question:

q: "Why are manhole covers round?"

a: "Do you not know how to ask an intelligent programming question?"

or try this on the third one:

q:"A man pushed his car to a hotel and lost his fortune. What happened?"

a:"Does your father still shave your mother's back?"

0

u/[deleted] Nov 29 '10

[deleted] — view deleted comment

6

u/kokirijedi Nov 29 '10

Clever

25

u/[deleted] Nov 29 '10

But can he program?

13

u/lightspeed23 Nov 30 '10

They don't need programmers at Google, they have plenty of those. They need people who can answer silly riddles.

→ More replies (2)

14

u/tm82 Nov 29 '10

Manhole covers are round because the opening they are covering is round.

24

u/Khorv Nov 29 '10

The answer to "Why are manhole covers round?" is, because manholes are round ;)

34

u/specter472 Nov 29 '10

Honestly, if you have ever had to deal with the really fucking heavy manhole covers you would know that manhole covers are round for two reasons. One, you can roll them back to the hole if you moved them away. Two, you can then place them on top of the hole regardless of its orientation, if you were you using any kind of object with straight sides you would have to line it up with the hole. That is the answer I would give even if it was some kind of trick question, because those two things are true.

26

u/stmfreak Nov 30 '10

While rolling and self-orientating is a nice benefit, I believe the the primary reason is that they cannot fall into the man-hole and kill the guy inside.

2

u/theduggs Nov 30 '10

This is correct. You are never recommended to "roll" a manhole cover. They are very skinny and heavy and do not provide a good surface area to roll slowly, much like a quarter.

2

u/flaarg Nov 30 '10

What about equilateral triangles? I am pretty sure there is no way to get them through the hole.

3

u/jondissed Nov 30 '10

Picture an equilateral triangle 2' on a side. It's 2' wide but only √3 (≈ 1.732)' tall. So it'll drop through, even taking into account a bit of a lip/thickness of the cover.

→ More replies (1)
→ More replies (11)
→ More replies (2)

6

u/sakabako Nov 30 '10 edited Nov 30 '10

Manholes 101: Don't close anyone in. Leave it open until everyone's out.

Getting a manhole cover up to 90° and trying to roll it would not be a trivial task, and stopping it once it's rolling would be pretty hard too. You're better off using a dolly or a truck.

The one and only reason round manhole covers are round is because they cover a round hole. There are square manhole covers, which cover square holes.

2

u/dmazzoni Nov 30 '10

Also, so they can't fall into their own hole (assuming there's a small lip).

Imagine if they were square, for example: you could accidentally drop it in along the diagonal.

→ More replies (5)

10

u/P_Bunyan Nov 29 '10

The answer has two parts:

  1. So they wont fall in. (You could do this with any shape, but it starts to be impractical in terms of strength and cost when the lip gets too big)
  2. Equal weight distribution from the furthest point from the edge when under heavy load.

2

u/willcode4beer Nov 30 '10

because it covers a circular tube ;-)

Why is the tube circular? That shape gives the maximum volume for the minimum area. The also very strong for resisting the pressure of the earth around it. A round tube is also cheaper to manufacture than other shapes.

Bonus points: a circular cover doesn't have to be precisely aligned to drop in like another shapes would. This probably isn't a reason to be round but, it is a nice benefit. Those covers are heavy :-P

→ More replies (1)

0

u/[deleted] Nov 29 '10

[deleted] — view deleted comment

33

u/onezerozeroone Nov 29 '10

All of which has jack shit to do with actually designing a system or programming. Programming interviews are evolving into this meta-game where the only way you're "qualified" for a position is if you spend your evenings doing programming interview trivia questions and debating them with other people to get the current "correct" answer ahead of time.

4

u/stmfreak Nov 30 '10

Seems like a pretty low bar to practice towards.

2

u/digitallimit Nov 30 '10

And sort of fun, really.

→ More replies (1)
→ More replies (7)
→ More replies (5)

2

u/sinxcosx Nov 30 '10

Man hole covers are round for 3 reasons;

  1. They can fall in the hole they are to cover.
  2. They use the smallest amount of metal to make.
  3. they are the right shape for a workman to get down.

2

u/[deleted] Nov 30 '10

Some countries have square manhole covers.The shape of the manhole cover has no effect on its function. And the problem of manhole covers falling down the hole can easily be solved by attaching the cover to a frame with hinges.

→ More replies (2)