Skip to content

Lesson 2 of 32The interview

Online Assessments

Beat the timed OA on HackerRank, CodeSignal or Codility: how hidden tests score you, partial credit, input parsing, TLE fixes and proctoring rules.

17 min read0/5 questions

The online assessment is the stage where the most candidates are cut, and nobody is in the room to see how you think. A program runs your code against tests you cannot see and turns it into a number. A recruiter then compares that number with a cut-off you are never told. Strong engineers fail OAs for reasons that have nothing to do with algorithms: they parse the input wrong, burn 40 minutes on the hardest problem first, or submit code that is correct but too slow for the largest hidden test. This lesson is about those mechanics, so the score reflects what you can actually do.

The formats you will meet

You saw in How Interviews Work that the OA is a cheap filter. Each platform builds that filter a little differently, and knowing the format tells you how to spend your time. The details below are what the vendors and candidates reported as of October 2026. Companies configure these tests themselves, so always read the instructions page and the email from your recruiter.

PlatformTypical shapeWhat decides the score
HackerRank2 to 3 problems in 60 to 90 minutes, sometimes plus multiple choice or SQLPoints per hidden test case passed, summed across problems
CodeSignal General Coding Assessment (GCA)4 tasks of rising difficulty, about 70 minutes, split your time as you likeA scaled score (200 to 600 per CodeSignal's help center), from correctness plus speed
CodeSignal Industry Coding Framework (ICF)One practical project in 4 levels, up to 90 minutes, each level builds on the lastHow many levels you complete, and how cleanly. You are not expected to finish all four
Codility1 to 3 tasks, often 60 to 120 minutesA percentage split into correctness tests and performance tests
Amazon SDE OA (reported)2 coding problems on HackerRank, then a work style survey and a work simulationCoding tests plus the survey and simulation, which are read against the Leadership Principles

Two details change how you prepare. First, a CodeSignal GCA score can be shared with several companies that accept it, so one good attempt can cover many applications, and one bad attempt follows you until you retake. Retake limits and score validity windows have changed over the years, so check CodeSignal's current candidate docs before you sit it. Second, the ICF is not LeetCode. It looks like real work: build an in-memory bank, file store or key-value database, then add features level by level. It rewards clean, extensible code more than clever tricks, which makes it closer to the take-home and pair-programming rounds later in this track.

How hidden tests score you

When you press submit, your code runs against a list of test cases. You usually see two or three of them (the samples). The rest are hidden, and they are written to hit specific weaknesses.

What a typical hidden test suite contains
  1. Sample testsThe examples in the problem statement. Passing them proves almost nothing
  2. Small correctness testsOrdinary inputs a little different from the samples
  3. Edge casesEmpty input, one element, duplicates, negatives, all equal values
  4. Large performance testsInputs at the maximum constraints, run under a time limit

The samples are there so you understand the format. Many submissions pass all of them and still score under 50%.

1/4

That last step is the most important strategic fact about OAs. The live interview rewards reaching the optimal idea and explaining it. The OA rewards points on the board. Codility makes the split visible: its report shows a correctness percentage and a performance percentage separately, so a hiring team can see "correct but slow" at a glance. HackerRank and CodeSignal show a single number, but the same arithmetic sits underneath.

Quick check
You have 15 minutes left on a 2-problem HackerRank OA. Problem 1 is fully solved. On problem 2 you have a correct O(n²) idea and a half-built O(n log n) idea. What gives the best expected score?
Need a nudge? A hint rules out a wrong answer.

A plan for the clock

The live playbook gives you a plan for one problem. An OA needs a plan for the whole session.

Spending a 70-minute, 4-task assessment
  1. 0-5 min

    Read everything

    Skim every task and its constraints. Note which one is clearly easiest and which looks like a time sink. Check the language version on the setup page.

  2. 5-20 min

    Bank the easy ones

    Solve the shortest tasks first, completely, and submit each one. Easy points are the same value no matter when you earn them.

  3. 20-50 min

    The medium task

    Get a correct solution submitted, even a slow one, then optimize. Read the constraint line before you choose the algorithm.

  4. 50-65 min

    The hard task

    Aim for partial credit. A brute force that passes small tests is a real result. Do not start a rewrite with 10 minutes left.

  5. 65-70 min

    Final submits

    Make sure every task has its best version submitted. Some platforms score only the last submission, not the best one.

Some rules that sit behind this plan:

  • Submit early, submit often. Many platforms score the last submission. If a later attempt breaks something, resubmit the working version before the timer ends.
  • Read the constraints line first. The lesson Constraints Are Hints covers this in depth: n up to 10⁵ rules out O(n²), n up to 20 invites trying every subset. In an OA the constraints line is the only hint you get.
  • Cap your time per stuck problem. If 15 minutes pass without progress, submit what you have and move on. Coming back fresh often unlocks it.
  • Use the custom input box. Most editors let you run your own input without spending a submission. Feed in the empty case, a single element, and the largest case you can type.

The environment: input, output and versions

Two styles of problem exist, and they fail in different ways.

In function-signature style (CodeSignal, LeetCode-like HackerRank tasks), you fill in a function and the platform calls it. Reading input is not your problem, but the signature is fixed. Do not rename parameters or change the return type.

In stdin/stdout style (classic HackerRank, some Codility tasks), your program reads raw text from standard input and prints the answer. This is where good solutions score zero. The usual culprits are a missing newline, an extra space, numbers left as strings, or reading line by line when the test file puts values on one line.

The safest pattern is to read all of the input at once, split it into tokens, and walk through them with an index. Line breaks then stop mattering. Here is a template you can rehearse until it is automatic. The platform would call main(sys.stdin). Here a string stands in for the input file.

Pythonread_input.py
import ioimport sys SAMPLE = """235 1 4210 20""" def solve(nums): return max(nums) - min(nums) def main(stream): tokens = stream.read().split() pos = 0 t = int(tokens[pos]); pos += 1 out = [] for _ in range(t): n = int(tokens[pos]); pos += 1 nums = [int(x) for x in tokens[pos:pos + n]] pos += n out.append(str(solve(nums))) sys.stdout.write("\n".join(out) + "\n") main(io.StringIO(SAMPLE))
Output
Press Run (⌘ Enter) to see what happens.

Two things to notice. All output is collected and written once, because printing thousands of lines one call at a time is a classic source of TLE in Python. And every number is converted with int straight away. Forgetting that conversion gives answers that look right on small samples and fail later:

Predict the outputPython

What does this print?

line = "10 9 2"
nums = line.split()
print(sorted(nums))
Need a nudge? Hints walk you through it.

In JavaScript the same idea is to read the whole input with require("fs").readFileSync(0, "utf8"), then split(/\s+/) and convert with Number. Check the platform's sample code for the exact boilerplate, because some HackerRank templates wrap input in event handlers.

Language versions matter. The platform may run an older Python or Node than you use at home. If you rely on bisect with key= (Python 3.10+), itertools.pairwise (3.10+) or the new max-heap functions in heapq (3.14+), check the version on the setup page or use the older idiom. JavaScript has no built-in heap. LeetCode's JS environment preloads a priority queue library, but HackerRank and CodeSignal do not, so have a short binary heap you can write from memory, or pick Python for heap-heavy problems.

Reading the verdict

Each failed test returns a short verdict. Each one points at a different kind of bug, so read it before you change code.

Match the pairs0/5 matched

Match each verdict to the most likely cause.

Choose an item, then its match on the other side.

TLE has two kinds of cause. The first is algorithmic: O(n²) where O(n log n) was needed. Only a better idea fixes that. The second is a constant factor hidden inside a loop, and it is more common than people expect. The usual suspects are x in some_list inside a loop (that is O(n) each time), list.pop(0) or JS shift() used as a queue (both O(n)), string building with += in JS or in a tight Python loop, and slow line-by-line input. Run this to see the hidden-O(n) problem in numbers.

Pythonhidden_linear.py
import time n = 3000items = list(range(n))queries = list(range(0, 2 * n, 2)) start = time.perf_counter()hits = sum(1 for q in queries if q in items) # list: O(n) per lookuplist_time = time.perf_counter() - start lookup = set(items)start = time.perf_counter()hits_set = sum(1 for q in queries if q in lookup) # set: O(1) per lookupset_time = time.perf_counter() - start print("same answer:", hits == hits_set, hits)print(f"list: {list_time * 1000:.1f} ms, set: {set_time * 1000:.2f} ms")print(f"set is roughly {list_time / max(set_time, 1e-9):.0f}x faster")
Output
Press Run (⌘ Enter) to see what happens.

The code looks identical apart from one name, and the answer is the same. At n = 10⁵ the list version does billions of comparisons and times out. That is why "correct but TLE on large tests" is so often fixed by one changed data structure, not a new algorithm.

Why Python gets TLE more often, and what platforms do about it

CPython runs plain loops tens of times slower than compiled C++ or Java. Some platforms give Python a larger time limit to compensate, but not all of them, and the multiplier is not always published. In practice: prefer built-ins that run in C (sum, sorted, set, collections.Counter, slicing) over hand-written loops, read input in one go, write output in one go, and avoid recursion for depth beyond a few thousand. If an OA is known to be performance-heavy and you know Java or C++ well, those are safe choices too. Pick the language you make fewest mistakes in.

Put it in order5 steps

Your solution gets TLE on the last 4 of 15 hidden tests. Put a sensible debugging order.

  1. Tap the steps below in the right order.
Need a nudge? A hint shows where it starts.

Proctoring and integrity

Most company OAs are now proctored to some degree. Depending on the settings a company picks, the platform can record your webcam and screen, log when you leave the tab or window, log pastes into the editor, and run similarity checks that compare your code with other submissions and with known solutions posted online. CodeSignal certifies a GCA score only if the session shows no unusual activity. A flag does not always mean automatic rejection, but it goes into the report a recruiter reads.

What usually counts as cheating: another person helping, pasting a solution from anywhere, and using an AI assistant when the rules do not allow it. What is usually allowed: reading official language documentation, if the instructions say so. Read the rules page each time, because companies set it differently.

The practical point is that cheating no longer pays even when it goes undetected. Live rounds re-check the same skills, and interviewers increasingly ask you to explain or extend your OA code. Google was reported in August 2025 to be bringing back at least one in-person round, partly over concerns about AI help in remote interviews. A candidate who passed an OA they could not have solved alone fails in the next round instead, after spending more time.

After you submit

Cut-off scores are private and set per company, per role and sometimes per hiring season. Ignore forum claims like "you need 830" or "you need all tests". The same score can pass for an internship and fail for a senior role. If you hear nothing for a week or two, a short, polite email to the recruiter asking about next steps is normal.

If you do badly, most companies apply a cooldown before you can apply again, commonly measured in months. CodeSignal limits GCA retakes within rolling windows, and the exact rules have changed, so check their current docs. The useful response is the same as for any failed round: write down which verdicts you got and why, and practice that weakness.

Quick check
Which preparation is most specific to OAs, compared with live coding rounds?
Need a nudge? A hint rules out a wrong answer.
Key terms
hidden test case
An input the platform runs your code on that you cannot see. Most of your score comes from these.
partial credit
Scoring per test case passed, so a correct but slow solution still earns the points for small and edge-case tests.
TLE
Time Limit Exceeded: the code was still running when the limit hit, usually on the largest inputs.
GCA
CodeSignal's General Coding Assessment: 4 tasks, a scaled score that some companies accept from a single sitting.
ICF
CodeSignal's Industry Coding Framework: one practical project in 4 levels, each building on the last.
stdin/stdout style
A problem where your program reads raw text input and prints output, so parsing and formatting are your job.
similarity check
An automated comparison of your code against other submissions and known solutions, used to flag copying.