Interview prep
Online coding assessment prep: how timed tests work and how to practice for one
What a timed online coding test usually involves, how to spend the clock, read constraints, test edge cases and set up your environment, and why the test's own rules come first.
The HIDEA AI team
10 min read

An online coding assessment is a timed test, usually taken alone in a browser, where you solve a few programming problems and an automated grader runs your code against test cases, many of which you can't see. Prepare by practicing timed sets, reading constraints closely, testing edge cases yourself, and reading the rules of your specific test before you start. Then follow them.
Read the assessment's rules first
Every assessment sets its own rules, and they come before any strategy in this post. Many online assessments are proctored. Some record your screen, camera or browser activity. Many forbid outside help of any kind, including other people, other tabs, search engines and AI tools. Read the invitation and the instructions on the start page, and follow them.
Employers differ, and some publish their position on AI tools. What some employers publish collects examples, and is using an AI interview copilot cheating explains how to separate practice from the real thing.
What does an online coding assessment usually look like?
Formats vary by employer and by platform. HackerRank, CodeSignal, Codility and similar services each have their own layouts and settings, and an employer can configure them differently for each role. In general terms, you can expect some of the following. Treat the invitation as the authority on your specific test.
- A fixed time limit for the whole test or for each problem, with a visible countdown.
- A small number of coding problems, often increasing in difficulty. Some tests add multiple-choice, debugging or SQL questions.
- A browser editor where you pick a language, and a function signature or an input format you must follow exactly.
- A few sample tests you can run, plus a larger set of tests you can't see, which decides most of the score.
- Rules about what you may open, and sometimes camera, microphone or screen monitoring.
Many platforms offer a practice test or a sample question before the real one. If yours does, take it. It is the cheapest way to learn the editor, the input format and the run button without the clock counting against you.
How is an online coding assessment scored?
Most coding questions are scored by running your code against test cases. The visible samples check that you read the format correctly. The unseen tests check correctness on edge cases and speed on large inputs. A solution that passes every sample can still fail many of the unseen tests.
Many formats give partial credit for the fraction of tests you pass, so a slower solution that is correct on small inputs still earns points. Some formats score differently, for example by weighting harder problems more, or by having a reviewer read the code afterwards. You usually won't know the exact rubric, so don't assume. The safe approach is the same either way: get something correct submitted, then improve it.
Time strategy for a timed coding test
The clock is the main difference between an assessment and practice at home. Decide your plan before you start, not when you are already behind.
- Skim every problem first. Spend a minute reading all of them, if the format allows it. Some tests lock each problem once you move on, so check the instructions.
- Set a budget per problem. Divide the time by the number of problems, and give harder ones a little more. Write the target end times down.
- Start with the one you can finish. An early full solve builds points and calm. Order matters less than finishing something.
- Submit a correct brute force early. If the fast solution isn't clear within your budget, submit the simple version to bank partial credit, then optimize.
- Time-box being stuck. If you've made no progress for several minutes, move on and come back. A fresh look often finds the bug.
- Keep a buffer at the end. Leave a few minutes to rerun the samples on every problem and confirm each submission saved.
How do you read constraints to predict the unseen tests?
The constraints section is the closest thing you get to seeing the hidden tests. It tells you the largest input the grader will try, which tells you how fast your solution must be. A rough guide, assuming a typical time limit of a second or two:
- Up to about 20 elements: exponential approaches, such as trying every subset, are often fine.
- Up to a few thousand: O(n²) is usually acceptable.
- Up to around a hundred thousand or a million: aim for O(n log n) or O(n).
- Values up to around a billion or more: watch for overflow in languages with fixed-size integers. Python's integers don't overflow, but they slow down when very large.
- "Can be empty", "may contain duplicates", "may be negative": each phrase is a test case waiting for you.
Python is slower per operation than compiled languages, so an approach that is fine in principle can still time out at the top of the range. If the limit is tight, prefer built-ins such as sorting and dictionary lookups over hand-written loops.
Edge cases to test before you submit
Unseen tests usually include the cases people forget. Run through this list on every problem and add your own tests in the editor where it lets you.
- Empty input, or a single element.
- All elements equal, or all duplicates.
- Negative numbers and zero.
- Already sorted, and sorted in reverse.
- The largest allowed input, to check speed.
- The answer at the very first or very last position.
- No valid answer at all, and what the prompt says to return in that case.
Partial credit: brute force first, then compare
A slow, correct solution has a second use beyond banking points. It becomes a checker for your fast one. Write both, then compare their outputs on many small random inputs. This is a standard practice technique called stress testing, and it is worth rehearsing at home so it is quick to set up.
import random
def max_pair_sum_fast(nums):
a, b = sorted(nums)[-2:]
return a + b
def max_pair_sum_slow(nums):
return max(nums[i] + nums[j]
for i in range(len(nums)) for j in range(i + 1, len(nums)))
for _ in range(1000):
nums = [random.randint(-10, 10) for _ in range(random.randint(2, 6))]
if max_pair_sum_fast(nums) != max_pair_sum_slow(nums):
print("mismatch:", nums)
break
else:
print("all random tests agree")The fast version sorts and adds the two largest values. The slow version tries every pair. If they ever disagree, the loop prints the failing input, which is usually small enough to debug by hand. Use this at home during practice. During a real test, use only what its rules allow. Some editors let you run custom input, and some don't.
Environment setup before test day
Small setup problems cost more time under a clock than they should. Settle them in advance.
- Pick one language and stay with it. Know how to read input, sort with a key, use a dictionary, a heap and a queue without looking them up.
- Practice in a plain editor without autocomplete for a few sessions. Some assessment editors offer little help.
- Check the input format. Some tests give you a function to fill in, others expect you to read standard input and print output.
- Run any system check the platform offers, on the same computer and browser you'll use.
- Use a stable connection, a charged or plugged-in laptop, a quiet room, and notifications switched off.
- If the test needs ID, a camera or a microphone, have them ready before the timer starts.
- Close everything the rules don't allow. That keeps you inside the rules and keeps your attention on the problem.
Worked example: reading one prompt
Here is an invented prompt and an example of how to read it before typing: "Given an array of up to 10^5 positive integers and a value k, return the length of the longest contiguous subarray whose sum is at most k. Return 0 if none exists."
"Up to 10^5 elements, so O(n²) is probably too slow. I want O(n) or O(n log n). Contiguous plus a sum condition suggests a sliding window, and all values are positive, so growing the window only increases the sum and shrinking only decreases it. The window works. Edge cases: a single element larger than k means 0, every element fits means the whole length, and k smaller than every element means 0 again. I'll write the window, run the samples, then add those three as custom tests."
That read took about a minute. It picked a target complexity from the constraint, checked that the pattern's condition really holds (positive values), and listed the edge cases before writing code. The coding interview patterns guide explains why the positive-values detail matters.
A practice plan for the week before
- Take the platform's practice test. If one is offered, do it early so the format holds no surprises.
- Run two or three full timed sets. Use the same number of problems and the same time limit as your invitation, if it says. Don't pause the clock.
- Review every miss. For each failed problem, write down whether it was the pattern, a bug, an edge case or time. Fix the category, not just the problem.
- Drill constraints and edge cases. Read ten prompts quickly and, for each, say the target complexity and three edge cases without solving.
- Rehearse the stress test once. Set up a brute force and a random comparison until it takes only a few minutes.
- Rest the day before. A tired read of the constraints causes more failures than a missing pattern.
Common mistakes
- Skipping the instructions. Rules about allowed resources, problem locking and submission differ between tests. Read them before the timer matters.
- Optimizing before anything passes. A clever solution that never compiles scores less than a simple one that passes half the tests.
- Trusting the samples. Passing visible tests says little about the unseen ones. Test the edge cases yourself.
- Ignoring the input format. Printing extra text or reading input the wrong way fails every test, including correct logic.
- Spending the whole clock on one problem. Time-box it. Points on two problems usually beat a perfect solution to one.
- Breaking the rules. Using forbidden help risks your candidacy, and an assessment exists to show what you can do yourself.
Practice beforehand on the Live coding surface
HIDEA AI has four separate surfaces: Verbal, Live coding, System design and Project. For assessment practice before the test, use Live coding. Work a practice problem yourself on a timer first. Then capture it from the screen, and compare your approach and complexity with the response, which leads with a plain-English approach, then code in the language you picked, then time and space complexity.
Keep it to practice. During the assessment itself, follow its rules, and if those rules forbid outside help, don't open any tool. You still speak or type every answer. Fifteen session minutes a day is free, with no credit card, on the desktop app for macOS and Windows. The FAQ answers setup questions, and the pricing page shows the plans.
Where to go next
- Learn the shapes that most problems reuse: coding interview patterns.
- Plan the rest of your preparation: a two-week technical interview preparation plan.
- If a live round comes next: live coding mock interview: narrate under a timer.
- Download the app for practice before test day.
Frequently asked questions
Can I use AI tools during an online coding assessment?
Only if the assessment's rules explicitly allow it, and many don't. Read the invitation and the instructions, follow them, and ask the recruiter in writing if anything is unclear. Use AI tools for practice before the test, not during one that forbids outside help.
Do online coding assessments give partial credit?
Many score the fraction of test cases your code passes, so a correct but slower solution can still earn points. Not every format works that way, and the exact rubric is often not shared. Submitting a correct simple solution early and then improving it is a safe approach either way.
How should I prepare for a HackerRank, CodeSignal or Codility test?
Take the practice test if one is offered, so the editor and input format are familiar. Then run timed problem sets at the same length as your invitation, review every miss, and drill constraints and edge cases. Check any system requirements in advance on the computer you'll use.
Why does my solution pass the sample tests but fail the real ones?
Sample tests are small and few. The unseen tests usually include edge cases, such as empty input or duplicates, and large inputs that check speed. Read the constraints to find the maximum input size, test the edge cases yourself, and make sure your approach meets the complexity the constraints imply.
Is an online coding assessment proctored?
Some are and some are not, and the level varies from browser monitoring to camera and screen recording. The invitation or start page usually says what applies. Whatever the setup, follow the rules you're given.



