Assessments · Aptitude tests

Coding test practice for apprenticeships

Practice for the coding assessments in software, data and digital apprenticeships: read code, work out what it does, and find the bugs.

Coding tests for apprenticeships check how you think about code, not how much you've built. Most employers expect beginners, so the questions stay close to the basics.

✦ Take a coding test

Loading…

What the test is like

Coding assessments vary more than any other test. Some are multiple choice, asking what a piece of code prints or where its bug is. Others give you a small problem to solve by writing code in the browser, on platforms such as HackerRank or Codility, where automatic tests check your answer. Some employers set a logical reasoning test instead, to see how you think rather than what you've learned.

This practice test is multiple choice, in the language the listing names, or Python if it names none. It covers the reading and reasoning that every format relies on: following code line by line, spotting bugs, and knowing how loops, conditions, lists and dictionaries behave.

An example question

Example · Tracing output
total = 0
for n in range(1, 6):
    if n % 2 == 0:
        total += n
    else:
        total -= 1
print(total)

What does this Python code print?

A3
B5
C6
D-3
Show the answer

Answer: A. range(1, 6) runs from 1 to 5. The even numbers, 2 and 4, add 6 to the total, and the three odd numbers each take away 1. 6 − 3 = 3.

Where you'll meet it

Software development, data and cyber security apprenticeships, at technology firms, banks, consultancies and the public sector. Many entry-level schemes don't expect any coding experience, so check the listing: if it asks for none, the assessment is more likely to be a reasoning test.

How to do well

How this practice test works

ApprentiFinder isn't affiliated with or endorsed by HackerRank, Codility or any other assessment provider. These are our own practice questions.

Common questions

Which programming language will the test use?
Usually the one in the job description, or your choice from a list. If the listing names none, Python is a good one to practise. This practice test uses the language the listing names, or Python.
Do I need coding experience for a software apprenticeship?
Not always. Many schemes are open to beginners and test how you think instead. Some experience, even a small project of your own, helps your application stand out.
What is a coding challenge?
A short problem you solve by writing code, often timed, with hidden tests that check your answer. A correct answer matters most, then how clear and efficient your code is.

Read next

Apprenticeship practice aptitude tests→Logical reasoning test practice for apprenticeships→Diagrammatic reasoning test practice for apprenticeships→Numerical reasoning test practice for apprenticeships→

Still looking for the role itself?

ApprentiFinder tracks live UK degree apprenticeship vacancies from the GOV.UK service, employer career pages and university portals — Levels 4 to 7, updated daily.

Browse live roles →