Programming = Problem Solving
Tags: beginners
Published: 2022-10-18 12:44:59

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:

How many people are there in Chicago? It is about 10 million people in the metropolitan area.
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.
Pianos need tuning about once a year, and it takes about an hour to tune a piano.
So, a piano tuner, with traveling around Chicago, would be able to tune about 4 pianos a day.
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.
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](https://www.businessinsider.com/hard-google-interview-questions-2016-10) 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](https://geni.us/iY4Inx) that might be useful.

---

This post is from my newsletter [Sunday Syntax](https://www.alexhyett.com/newsletter/) where every Sunday I share tips, tools and actionable advice for software developers, straight to your inbox.