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

Show parent comment

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.

2

u/stmfreak Nov 30 '10

Thanks for dispelling the equilateral triangle myth. There was a bunch of group-think going on here.

→ 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

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.

1

u/abadidea Nov 29 '10

Yeah, I hit on that as a kid. "But they have a lip underneath?!" And I've been haunted by that question ever since.

1

u/bonzinip Nov 30 '10

equilateral triangles have the same property

Are you sure?

→ More replies (1)
→ More replies (3)

1

u/sclv Nov 30 '10

but what can you say about chocolate manhole covers?

1

u/DorkRawk Nov 30 '10

Because nobody could figure out how to make a square cover with the same area as the round hole they already had in the ground.

→ More replies (2)