Python to the Rescue for Manhole Cover Interview Questions

John Clark Craig
6 min readMar 1, 2021

Be prepared to surprise them during your next job interview!

Photo by Mohammad Rezaie on Unsplash

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.

Photo by Brett Jordan on Unsplash

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.

--

--

John Clark Craig

Author, inventor, entrepreneur — passionate about alternate energy, technology, and how Python programming can help you hack your life.