Mastering Codility’s Online Coding Test — My Top Tips

Lior Amouyal
saas-infra
Published in
3 min readDec 19, 2022
Succeeding on your online coding test. DALL-E 2022

It’s no secret that the process of applying for a job can be quite lengthy. In addition to interviews and possibly completing a home assignment, you may also be asked to take an online coding skills test. One popular platform for these tests is Codility.

The test consists of several programming problems that you will need to solve within a predefined time frame. Every minute counts, so it’s important to use your time wisely.

This guide offers some preparation tips and things to keep in mind during the test to help you succeed.

This post is not affiliated with Codility and is simply a personal account of my experience with the platform. I hope that sharing my experience may be helpful to some readers.

Should you prepare for this test?

It is optional, but I recommend you do.

How can I prepare for a Codility test?

  1. Focus on one programming language.
    Codility’s platform supports various programming languages, including C, Java, Javascript, and Python, so choose the one you feel most comfortable using.
  2. Know the basics.
    It is important that you are familiar with basic array, string, and object/dictionary operations, including their parameters, return values, and edge cases. This will help you avoid wasting time during the test by having to look up basic information.
  3. Practice.
    Codility offers a variety of lessons, exercises and challenges to help you prepare and improve your skills. The more of them you complete, the better prepared you will be.
  4. Simulate.
    Take Codility’s demo test.
  5. Playground.
    Use your preferred IDE for writing your solution. When you are finished, paste your code into Codility’s UI. Your familiar IDE will format your code properly, highlight syntax and may even yell at you when you write bad code. This method is also recommended by Codility.
  6. Test your code!
    Write simple yet thorough tests that run your solution on variety of inputs and verify that it produces the correct output. I recommend writing these tests before implementing your solution (TDD-style), this will help you understand the problem and consider all edge cases.
  7. Final preparation tip:
    I suggest creating templates for the problems you will be solving, each template should include all the boilerplate code needed to test a generic solution. This method will save you precious time during the test.
    Here’s a very simple example (in Javascript):
function mySolution(PARAMS_AS_DESCRIBED_IN_PROBLEM_SET) {
IMPLEMENTATION_GOES_HERE
}

// Test cases
console.log(mySolution(INPUT_PARAMS_1))
console.log(mySolution(INPUT_PARAMS_2))
console.log(mySolution(INPUT_PARAMS_3))

It is probably better to use assertions or your preferred testing library to further enhance your testing process, but even just using this simple skeleton can save you a lot of time. To use this skeleton, start by carefully reading the problem you are trying to solve. Then, enter the function parameters described in the problem, add input parameters to the test cases (you can add as many test cases as you want), and finally begin implementing your solution.

During the test

  1. Breathe 🙂
  2. Read the test instructions carefully.
  3. Wisely divide your time between all questions. If you think one question is easier, start with it, but leave enough time for the rest.
  4. Similar to the preparation stage, use your preferred programming language and IDE. And do not forget to write comprehensive tests to ensure the correctness of your solution.
  5. Do the best you can, good luck!

Have a few tips of your own? Please share them in the comments section 💪

--

--

Lior Amouyal
saas-infra

Experienced software engineer. I’m interested in coding, any type of rock/metal music and being the best dad I can be 💪 Linkedin: linkedin.com/in/amouyal/