Programming = Problem Solving

Programming = Problem Solving

by | 4 min read
Originally posted on newsletter.alexhyett.com
Published:
Updated:

My first job out of University was for a software consulting company in Bath, England.

This company mostly exclusively hired graduates from the surrounding universities such as Bath and Bristol.

Unlike other companies, however, they weren’t specifically looking for computer science graduates, they were more interested in those with science and maths degrees.

In fact, they rarely hired computer science graduates, which might seem odd at first glance for a software company.

The company realised that the key to being a good software engineer is not about knowing how specific algorithms work or understanding the intricacies of how computers process code.

The only thing that matters is being good at problem-solving.

I studied Physics at University, and a large part of the course was using maths to solve real-world problems. You were given a problem to work out, and it was up to you to make the correct assumptions and use the right equations.

The reason the company hired Maths and Physics graduates is because it is easier to teach programming than it is to teach problem-solving skills.

Maths and physics graduates were almost guaranteed to have good problem-solving skills, but for computer science graduates this wasn’t a given.

That is not to say computer science graduates are incapable of problem-solving it is just easier to teach programming.

If someone is applying for a software development job, then there is a good chance they have an aptitude for it already. Although, even on my Physics course, some people really struggled with programming too.

I remember my interview there quite vividly. It was 2 hours long, and it was split into problem-solving questions and then a conversation about my interests. I remember talking in depth about e-ink displays, which were quite new back then. They just wanted to see if I had a passion for technology.

One question I remember being asked was, “How many piano tuners are there in Chicago?”.

There isn’t one correct answer, but the interviewers wanted to know my thought process and how I would break down this problem into steps.

Before I give you how I answered this question, have a think yourself how you would go about answering this.


Not knowing much about Chicago (being from the UK) I remember drastically underestimating the population; however, it didn’t really matter for my answer.

This was the thought process I went through:

  1. How many people are there in Chicago? It is about 10 million people in the metropolitan area.
  2. How many people have a piano? This is quite subjective. I based it on the roughly 100 people I know, of which only 2 have a piano, so let’s say 2% = 200,000 piano owners.
  3. Pianos need tuning about once a year, and it takes about an hour to tune a piano.
  4. So, a piano tuner, with traveling around Chicago, would be able to tune about 4 pianos a day.
  5. If they work for 46 weeks of the year, that is 230 days (assuming a 5-day week). Therefore, 1 piano tuner can tune 920 pianos a year.
  6. Assuming an equal supply and demand of piano tuners, you would need 200,000 / 920 = 217 piano tuners in Chicago to match the demand.

This problem is what they call a Fermi Problem and is named after physicist Enrico Fermi.

It is a back of the envelope calculation that you can use to come up with a good estimation with no actual data.

As a software developer, problem-solving and estimating is an important skill that you need to develop, and you don’t even have to write any code to do it.

Similar questions that get asked include:

  • What is the total cost of someone’s possessions traveling from London to Glasgow at 7 am on a Monday?
  • What is the weight of the Empire State Building?
  • How many golf balls can fit in a school bus?

Google used to include these sorts of questions in their interview process, but have since banned them as candidates were finding them too difficult.

If you want to be a successful developer, however, these can help you get better at problem-solving.

If you want more practice at solving these types of problems, there is a good book called “Maths on the Back of an Envelope” by Rob Eastaway that might be useful.

Enjoy the rest of your weekend.

Alex


🧑‍💻 Latest from me

This year, I am taking a creative sabbatical, so I can share my knowledge with you lovely people. This includes this newsletter as well as YouTube videos and articles on my blog.

This marks the end of the first week of publishing, I am excited to share more.

🎬 YouTube - Is Programming the Right Career for You? If you are brand new to programming, I cover whether programming might be a good career choice for you.

📝 Article - How to Know if Programming is the Right Career for You? Supplemental article to the above video for those that prefer reading 🙂.

🎬 YouTube - Basics of Coding | Programming for Beginners I cover all the basics from IF Statements to Loops that you need to know first.


🙏 Was this helpful? If you want to say thanks, I love coffee ☕️ , any support is appreciated.