How to Solve Any Code Challenge or Algorithm

James Dorr
The Startup
Published in
7 min readJul 19, 2019

--

“Know algorithms!” When you’re searching for jobs in tech, this is frequent advice. Most articles about algorithms and coding challenges seem to recommend practicing them so much that you‘ll recognize almost anything an interviewer might ask you. Practicing algorithms and explaining the solutions out loud are very important — you want to be able to explain your ideas — but problem solving in software and web development requires more than rote memorization.

Computer Science is a science of abstraction.

-Alfred Aho

Being abstract is something profoundly different from being vague… The purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely precise.

-Edsger Dijkstra

Good code is abstract, so let’s apply that same logic to our problem solving! These steps are not specific and can be applied to most code challenges.

Summary

We only need a few oft-repeated steps to solve any code challenge.

  1. Understand the Problem
  2. Choose a general direction
  3. Identify what you can do

--

--

James Dorr
The Startup

Full Stack Web Developer, former English as a foreign language teacher and volleyball coach. All views and opinions are my own.