Member-only story
Python to the Rescue for Manhole Cover Interview Questions
Be prepared to surprise them during your next job interview!
As the story goes, a bright young programmer interviewing at Google (or was it Microsoft? Or Facebook? … take your pick) was asked to explain why manhole covers are always round, and not square or some other shape.
The standard, very logical explanation is that round covers won’t fall through the hole they cover, taking into account the lips around the edges of the lid and the hole it snuggly fits into. Supposedly, round is the only shape where this is possible.
As a thought experiment, pick up a square manhole cover, and drop it diagonally on edge between the corners of the hole. But make sure nobody is down there first! Notice you can’t do this with a round cover, because the distance across the circular shape simply won’t fit down the hole, no matter how you turn it.
Yes, There Really Is Another Answer
Actually, there are an infinite number of unique manhole shapes that cannot fall through the hole they cover, no matter how they are turned. Some explanation is in order.