At Northcoders we put huge emphasis on problem solving skills. Being a programmer is about solving problems with a specific toolset. In fact, building software can be thought of as composing lots of small solutions into one big one. From the very start of the application process, we encourage students to get stuck into problem solving with online platforms such as Codewars, and throughout the course students continue to spend at least an hour of the day working purely on interview-style coding katas to keep their skills sharp.
Whether you're new to coding, looking for your first job or already moving up the software career ladder, we believe that continuing to flex your problem solving skills is hugely important. For beginners, completing katas helps you gain fluidity in the language you're using and begin to recognize and internalize common patterns for solving problems. For more advanced coders, solving katas is a mental workout: it strengthens and exercises the parts of your brain you use daily in your work.
Training the brain to problem solve is like any other kind of training: "By practicing in a repetitive manner the learner develops the ability to execute those techniques and movements in a natural, reflex-like manner." (Wikipedia).
Being able to code in a reflex-like manner looks, to a beginner, like something superhuman but it's really only the result of hours upon hours of repetitive practice.
In this post, I'll give you some solid advice for using Codewars as a repetitive practice tool. An algorithm for solving a kata, if you like.
The Kata Algorithm
- Find a kata. Don't aim too high, don't aim too low. Try to find a kata that you have a vague idea how to solve, but whose entire solution doesn't appear immediately obvious. If it takes you longer than a few minutes to understand the kata description, you might decide to pick another one.
- Make sure you really understand what the kata is asking you to do BEFORE you begin. Try to identify parts of the problem you can extract and break down. Are there any little things you could make a function for immediately? Can you make some notes to yourself of the rough outline of steps you might need to do to solve the problem?
- Give them your very best shot - even if a single one takes 3 hours. Frustration is your friend. Work outside your comfort zone and give your brain the challenge it requires to learn most effectively.
- Always do katas in your integrated development environment (IDE), so that you can tackle the problem with test driven development. TDD is an incredibly powerful methodology. It forces you to think about what the function's purpose is. This is at the very core of what we do as developers. If you don't know how to do TDD, that's fine - just make sure you can run your code somewhere where it's easier to read the console output, such as JSBin.
- After you have successfully submitted a kata, take a break - have a cup of tea, read some news online, whatever will take your mind off the problem for 10 minutes
- Come back and study the best solution. What features of the language did the author of the best solution use? Do you know them? If not, you have to google them making sure to add 'mdn' to your search term e.g. 'splice mdn'.
- Study that whole page on MDN (Mozilla Developer Network). Your aim is not to memorise the API - there are better things to fill your brain with and the MDN API docs will always be there for you. Your aim is to familiarise yourself with something new, for example, how splice works. Why? So that it might occur to you to use '˜splice' when a similar scenario presents itself in the future.
- If you can't complete a kata, copy the url into a notebook and move on to the next. Every week or so come back to the ones you couldn't solveby pasting the URL back into your browser. The fact that you can subsequently solve them with what you've since learnt is a real confidence boost.
Do you use Codewars? Do you have any tips of your own? We'd love to hear - tweet us!