by Silhouette · 4y ago · 0 comments
That was always one of the worst standard brain-teaser questions because so many people who asked it didn't know the correct answer.
Hint: If your answer was that a circular cover is the only shape that can't fall down the matching hole, everything you think you know about the world is wrong and the term you're looking for is "curve of constant width".
The real answer is because manhole covers are mass produced and manufacturing circular ones is usually easier and cheaper than the alternatives.
However, one thing that none of this depends on is a circular cover being the only shape that can't fall down the corresponding circular hole. That was the standard answer that way too many companies that used this particular interview question wanted and it was wrong.
https://duckduckgo.com/?q=rectangular+manhole+cover&t=brave&...
https://duckduckgo.com/?q=triangular+manhole+cover&t=brave&i...
https://duckduckgo.com/?q=hexagonal+manhole+cover&t=brave&ia...
https://duckduckgo.com/?q=oval+manhole+cover&t=brave&iar=ima...
And so on... Now a great - though a bit unfair - question would be to ask about circular ones, listen to the standard pitch, and then show these photos and ask - so what's going on here? Are all these people idiots?
A good software engineer knows there are rules, and there are reasons for the rules, and there are reasons why sometimes rules need to be different because the situation is different. If you just learn one single "right" answer, you'd end up trying to fit a round manhole cover into a triangular opening.
My understanding is the primary reason is because circular covers cannot fall into the hole itself, whereas that problem exists with other shapes like squares.
Shapes of constant width (e.g. £1 coin) won’t fall into the hole either. Neither would an equilateral triangle.
Oh, and by the way in my country we have square-shaped manhole covers too :O
The OP mentions curves of constant width:
https://en.wikipedia.org/wiki/Curve_of_constant_width
Which includes circles and Reuleaux triangles, which are much more difficult to manufacture than circles. I think this can be rounded off to "circles are the only well-known shape that can't fall into a similarly-sized hole".
Still, as I’ve said, there are square-shaped manhole covers too.