Practice Problem Solving with JavaScript

Practice coding in JavaScript by breaking down a problem, researching, & refactoring

Nnenna
8 min readMay 10, 2022
Image Source — https://krasimirtsonev.com/blog/article/build-your-own-interactive-javascript-playground

Someone in my network recently reached out to get help with writing algorithms with JavaScript. I was delighted to be a resource in any way possible, although I didn’t know exactly what that would look like in practice.

Interviews are hard. Coding while problem solving and talking through a solution can be an intense process that’s nerve-wrecking and draining. But having a general process for approaching the problem can help steer you in the right direction to solve it.

She sent me an algorithm prompt and asked how I would’ve written the solution for it. But I didn’t want to simply send my solution to her. There’s more that goes into that process than just writing the code. There’s also:

  • figuring out and explaining how to break down a problem into comprehensible steps
  • refactoring to improve the logic and readability when possible
  • if possible, leveraging online resources like a developer would on the job to solve parts of a problem

So let me break down exactly how this problem can be solved in a real world sense!

Background

--

--

Nnenna

Software Engineer @OReillyMedia. @Google @WomenTechmakers Scholar. Resilient Coder. world traveler.