Ace a practical coding test

In the previous semester of my engineering degree, I was required to undertake a class teaching C++ implemented on hardware applications. At the start, it was a tough class but my programming skills further developed and I got to learn more advance topics in the language. One fun assignment I had to complete was to implement a traffic light system on hardware which can you can view in the archives.

The reason it was a tough class was because it consisted of three practical coding tests worth a fair chunk of my final grade. These practical tests were marked by a computer auto tester and not the tutorial teacher. These were the following guidelines of undertaking the practical test:

  • Closed book test, so no notes or online resources
  • If your code does not compile, you get zero
  • Even if your code is correct, if it doesn’t run, you still get zero for the test
  • To see if the code is correct, the code will be marked by a series of tests run by the auto tester to see if it has implemented the correct code

As you can see, these tests were not going to be easy. The first practical coding test, 95% of the students failed including myself. Since the majority of the students failed, we were all given a resit. 90% of students still failed and again myself included.

My first practical coding test result

lab exam 1

Since that disaster, I was able to break down and figure out how to prepare for these tests. The advice I am about to show you led me to acing my final practical coding test.

Final practical coding test result 

lab exam 3

Step 1: Find out what concepts the test will cover

The first thing to do is to gather a list of what programming concepts we will be required to understand. Without proper practice and understanding the fundamental programming concepts, you will have to resort to rote memorization to reproduce the code. An example I can give was my first practical programming test. It covered the following programming concepts:

  • Control loop statements
  • Bitwise operators
  • Control arguments
  • Reading and writing to text files

Step 2: Get a copy of the code solution

The truth is that lecturers and interviewers don’t have time to reinvent the wheel by creating hard coding tests. There several resources online which cover practical tests given in programming interviews. These resources include Interview cake, programmer interview and coding for interviews. I was lucky that my practical coding tests consisted of us having to rewrite the class lab tasks from scratch.

Step 3: Test yourself by writing the code solution from scratch

Now this is the hard part. By being able to ace a practical coding test, you will be required to write the code from scratch. This will require you to complete the task without peeking at the solution code or any notes. You will need to train yourself to do this because this is where you brain is doing most of the work. When you can’t remember a chunk of code, your brain will be creating connections trying to retrieve it, so that you can easily remember it when you re test yourself. You need to understand that it’s fine if you can’t remember certain parts of the code solution. This is actually a good thing because it allows us to find the loops in your understanding and memorisation. Just don’t leave the preparation until it is too late, otherwise that’s a recipe for disaster.

Step 4: Repeat the previous step until you are confident in writing the code from scratch

If you can rewrite the code from scratch once, that’s great. But unfortunately that’s not 99% of us. You will need to keep testing yourself by repeating step 3 until you are confident in writing the code from scratch without looking at the solutions. Keep doing this until you are 100% confident, so that you can walk into the test without having an anxiety attack.

And that’s how you ace a practical coding test.

Share this post