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.
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.
| Platform | Typical shape | What decides the score |
|---|---|---|
| HackerRank | 2 to 3 problems in 60 to 90 minutes, sometimes plus multiple choice or SQL | Points 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 like | A 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 last | How many levels you complete, and how cleanly. You are not expected to finish all four |
| Codility | 1 to 3 tasks, often 60 to 120 minutes | A 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 simulation | Coding 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.
The samples are there so you understand the format. Many submissions pass all of them and still score under 50%.
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.
A plan for the clock
The live playbook gives you a plan for one problem. An OA needs a plan for the whole session.
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.
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.
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.
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.
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.
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:
What does this print?
line = "10 9 2" nums = line.split() print(sorted(nums))
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 each verdict to the most likely cause.
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.
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.
Your solution gets TLE on the last 4 of 15 hidden tests. Put a sensible debugging order.
- Tap the steps below in the right order.
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.
- 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.