InterviewPrepInterviewPrep· Job Insights

Codility Test Practice for Software Roles

Codility is favoured by employers precisely because it scores efficiency, not just correctness, so a working solution can still lose half its marks by being too slow. Understanding how its dual scoring works changes how you write every line. This page explains the task format, the correctness-versus-performance split, and how to practise for full marks.

Start a free mock interview →

How Codility tasks are built

A Codility assessment usually presents a small number of algorithmic tasks in a browser IDE, each with a clear specification, worked examples, and explicit constraints on input size and value ranges.

  • Task descriptions state the expected complexity target either directly or through the constraints.
  • You choose your language from a supported list.
  • Verify and submit: you can run the provided examples before final submission.

Task themes commonly include array manipulation, prefix sums, hashing, two-pointers, sorting, stacks, and basic greedy or counting problems. The specifications are precise, and reading the constraints tells you the intended efficient approach before you write a single line, which is exactly the discipline Codility is testing.

Correctness versus performance scoring

This is Codility's defining feature and the one that surprises candidates most. Each task is scored on two separate axes: a correctness score from functional test cases, and a performance score from large-input tests that check your time complexity. Your task total combines both.

The practical meaning is stark: a brute-force solution that returns the right answer can pass every correctness case yet score zero on performance, capping your total at roughly half. If a task allows arrays of up to a hundred thousand elements, an O(n squared) solution will time out on the performance tests. You must therefore aim for the target complexity, often O(n) or O(n log n), from the very start rather than planning to optimise later, because there is rarely time to rewrite.

Edge cases and timing tactics

Codility specifications are precise, and edge cases are frequently tested explicitly rather than left implicit.

  • Check boundaries: empty arrays, single elements, all-identical values, and the minimum and maximum allowed values.
  • Watch overflow: sums of large arrays can exceed 32-bit integer range, so choose the right type.
  • Respect the range constraints: they often hint at the intended algorithm, such as counting sort when values are bounded.

On timing, read all tasks first, secure the one you can fully solve efficiently to bank guaranteed marks, and avoid sinking the entire window into a single hard task while an easier full-mark solution waits untouched. Deliberate task selection is as important on Codility as raw algorithm skill.

How to practise for Codility

Practise writing solutions that meet a stated complexity target rather than just passing the examples, because that is precisely what Codility rewards and what ordinary practice neglects. Drill the recurring patterns, prefix sums, hashing, two-pointers and counting, and after each solution ask yourself whether it would survive a large-input performance test.

Use a browser editor and the language you are fastest in, and always test boundary cases before submitting. Make reviewing your solution's time and space complexity a reflex, not an afterthought, so that efficiency is baked into your first draft. Over time this habit turns the performance score from a trap into an easy source of full marks.

From the Codility screen to the interview

Once you clear the Codility screen, an interview usually follows in which you must explain your reasoning aloud, justify your complexity choices, and respond to changed constraints on the spot. The automated test rewards efficient code; the interview rewards being able to talk through why it is efficient.

InterviewPrep's free AI voice mock interview builds a session from your CV and the job description and scores your explanation, pace and filler words. It is a useful next step for the conversation round after the automated test, helping you rehearse narrating your approach and trade-offs so your problem-solving comes across as clearly in person as it did on the platform. A productive drill is to take a task where you achieved full marks and explain aloud not just what your solution does but why its complexity meets the constraint, and what a naive approach would have cost. Because Codility trains you to think about efficiency from the outset, you enter interviews with a genuine advantage on complexity questions, and articulating that reasoning out loud converts a quiet strength on the platform into a visible, persuasive one in front of an interviewer.

Most candidates who put in this practice then apply through Freshers Jobs Off Campus Drive listings on company career pages and job platforms, so keep alerts on for the firms you target.

Frequently asked

Why did my correct Codility solution score only 50 percent?
Almost certainly because it passed the correctness tests but failed the performance tests. Codility scores time complexity separately, so a brute-force answer that is functionally right but too slow on large inputs loses its performance marks, capping your total task score.
How do I know the required complexity for a Codility task?
Read the constraints. If arrays can reach a hundred thousand elements, an O(n squared) approach will time out, signalling that an O(n) or O(n log n) solution is expected. The input-size and value ranges are deliberate hints toward the intended efficient algorithm.
Can I test my code before submitting on Codility?
Yes. Codility lets you verify your solution against the provided examples and your own custom inputs before final submission. Use this to check boundary cases like empty arrays, single elements and maximum values, since edge cases are frequently part of the hidden correctness tests.
What topics should I practise for Codility?
Focus on array manipulation, prefix sums, hashing, two-pointers, sorting, stacks, and basic greedy or counting problems. Crucially, practise achieving a target time complexity rather than only passing examples, since Codility's performance scoring is what most often reduces otherwise-correct submissions.
Does Codility allow any programming language?
It supports a range of common languages, and you pick from the available list per task. Use the one you are fastest and most accurate in, but ensure your chosen language and approach are efficient enough to meet the task's performance requirements on large inputs.

Related prep

Tcs Nqt Mock Test · Tcs Nqt Aptitude Practice · Tcs Nqt Coding Practice · Infosys Infytq Preparation

Reading about it isn't practice.

Run a real AI mock interview built from your CV and a live job description — scored feedback on your answers, pace and filler words.

Start your free mock interview →