How to Prepare for a Coding Exercise: The Complete Guide
By Rehearsa Team · 2026-09-19
A coding exercise is not only a test of whether you can make a function return the right value. It tests how you understand an unfamiliar problem, choose trade-offs, verify your work and explain decisions under time pressure. Candidates often prepare by solving as many puzzles as possible. Strong candidates prepare for the actual format they will face.
This guide covers take-home tests, timed online assessments and live collaborative coding. It explains how HackerRank, Codility, CodeSignal and CoderPad are commonly used, how to prepare for each, a seven-day practice plan, and a model walkthrough you can reuse. Employers configure these platforms differently, so always treat your invitation and its rules as the final authority.
What a coding exercise actually assesses
Most exercises combine six signals:
- Correctness — does the solution produce the expected output, including on hidden edge cases?
- Problem solving — did you turn the prompt into clear requirements before coding?
- Efficiency — is the time and memory complexity appropriate for the input limits?
- Code quality — are names, structure and assumptions understandable to another engineer?
- Testing — did you check normal, boundary and invalid inputs instead of trusting one example?
- Communication — in a live exercise, can the interviewer follow your reasoning and collaborate with you?
The weighting changes by employer. A timed automated screen may emphasise test cases and runtime. A live pair-programming interview may value communication, debugging and response to hints just as highly as the final code. A take-home exercise may add architecture, documentation and maintainability.
Know which format you are preparing for
| Format | What you usually do | What often matters most |
|---|---|---|
| Timed online assessment | Solve one or more tasks in a browser before a fixed deadline | Correctness, hidden tests, complexity and time management |
| Live collaborative coding | Share an editor with an interviewer and solve while talking | Reasoning, communication, testing, debugging and coachability |
| Take-home exercise | Build or extend a small project over several hours or days | Requirements, design, code quality, tests, documentation and scope control |
| Debugging or code review | Find defects, improve existing code or discuss a pull request | Reading unfamiliar code, prioritisation and practical judgement |
Before practising, confirm the language choices, duration, number of tasks, whether a human will be present, and what external resources are permitted. Do not assume every coding round is an algorithm puzzle.
How the main coding assessment platforms work
A platform name tells you about the environment, not the employer's exact rubric. Employers choose the questions, settings and review method, so two assessments on the same platform can feel very different.
HackerRank
HackerRank is commonly used for timed screening tests and live technical interviews. A test can contain coding problems, SQL, multiple-choice questions or role-specific tasks. Coding answers are normally checked against visible examples and additional hidden test cases. Employers can review submitted code and may enable integrity controls.
How to prepare for HackerRank
- Use HackerRank's candidate practice environment before the real invitation so running code and reading test output feel routine.
- Practise parsing input and returning output in your chosen language.
- Expect hidden edge cases. Test minimum input, duplicates, negative values, already-sorted data and the largest plausible input.
- Read every constraint. A solution that works for 100 items may time out for 100,000.
- If the test includes SQL, practise joins, grouping, window functions and null handling separately.
- Follow the exact rules on documentation, external tools and AI assistance. Secure or proctored settings vary by employer.
Codility
Codility is used for automated coding tests and live pairing sessions. Tasks typically provide a function signature, examples and constraints. Solutions can be evaluated for correctness and, where relevant, performance on unseen tests. A solution can pass the example and still lose marks because it fails an edge case or scales poorly.
How to prepare for Codility
- Work through Codility's public lessons and demo-style tasks in your chosen language.
- Translate constraints into a complexity target before coding. Large inputs often rule out nested loops.
- Learn to state complexity clearly: “one pass is (O(n)), and the set uses (O(n)) extra space.”
- Build an edge-case list before submitting, including the smallest legal input and boundary values.
- Create a correct baseline first, then optimise if the constraints require it.
- Re-read the function contract. The right values in the wrong type can still fail.
- Check whether identity verification, monitoring or AI assistance rules apply to your particular invitation; these options are not identical for every test.
CodeSignal
CodeSignal supports company assessments and live interviews. Depending on the invitation, you may receive a structured assessment or a custom employer test. Its General Coding Assessment has commonly used a four-question, 70-minute format, but never assume your invitation uses that assessment or scoring model.
How to prepare for CodeSignal
- Confirm the assessment type and rules in your invitation rather than relying on another candidate's experience.
- Practise in CodeSignal's environment so you know where to run tests, inspect results and move between tasks.
- In a multi-question test, scan the full set first. Secure straightforward points before committing most of the session to one difficult problem.
- Write small helper functions with clear names; dense code is harder to debug under a clock.
- Use custom tests where available and check boundaries, repeated values and off-by-one errors.
- If the assessment is proctored, prepare permitted identification and test camera, microphone and screen-sharing access before the session. Not all CodeSignal assessments are proctored.
CoderPad
CoderPad is strongly associated with live collaborative technical interviews, although employers can also use it for take-home and screening work. In a live pad, the interviewer sees the code develop and may ask questions, provide information or change a requirement. The exercise is both technical and collaborative.
How to prepare for CoderPad
- Open a sandbox in your chosen language and practise without relying on your full local development setup.
- Narrate decisions in short sentences: “I will use a map because we need constant-time lookups.”
- Ask clarifying questions before typing. Confirm input shape, duplicates, error handling, scale and return value.
- Start with a simple correct solution when appropriate, then explain the bottleneck and improve it.
- Test as you go. A small example after each meaningful step is better than finding several defects at the end.
- Treat hints as collaboration, not failure. Acknowledge the hint, update your understanding and continue.
The framework: Clarify, Plan, Code, Test, Explain
Use the same five stages in practice and in the real exercise.
1. Clarify
Restate the task in one sentence. Identify inputs, output, constraints and ambiguous cases. In a live interview, ask focused questions. In an automated test, extract the answers from the prompt.
2. Plan
Describe the simplest valid approach before writing syntax. Name the data structure, main steps and expected complexity. If there are trade-offs, state them.
3. Code
Implement in small, checkable steps. Use descriptive names and avoid unrelated abstractions. In a live interview, speak at decision points without narrating every keystroke.
4. Test
Run the provided example, then add your own cases. Trace at least one case manually. If something fails, diagnose from the evidence rather than rewriting at random.
5. Explain
Summarise why the solution works, its time and space complexity, its limitations, and what you would improve with more time.
A model coding-problem walkthrough
Example prompt: Given an array of integers and a target, return the indices of two different elements whose values add to the target. Assume exactly one valid pair exists.
A strong live response could sound like this:
“I want to confirm that I should return the two indices, not the values, and that I cannot use the same element twice. The direct approach checks every pair in (O(n^2)) time. I can improve that by making one pass and storing each value's index in a map. For each number, I calculate the complement and check whether it has already appeared. That gives (O(n)) expected time and (O(n)) space. I will test a normal case, a pair containing a negative number, and a case where the same value appears twice.”
That demonstrates requirements, a baseline, an improved plan, complexity and tests before implementation. If you forget a language method, say what operation you need and continue. Reasoning is more valuable than pretending.
Test at least:
[2, 7, 11, 15], target9→[0, 1][-3, 4, 3, 90], target0→[0, 2][3, 3], target6→[0, 1]
The duplicate-value case proves that the implementation does not reuse one index.
A seven-day preparation plan
Seven focused sessions are more useful than seven days of passive reading. Combine adjacent days if your assessment is sooner.
Day 1 — Decode the invitation. Identify platform, format, language options, time limit, task count, deadline and permitted resources. Open the official practice environment and run one trivial program.
Day 2 — Establish your baseline. Complete two representative problems under a generous limit. Record where time went: understanding, algorithm choice, syntax, debugging or testing. Practise the bottleneck you actually have.
Day 3 — Refresh core patterns. Arrays and strings, maps and sets, sorting, stacks and queues, tree or graph traversal, and basic recursion. Add SQL, frontend state, API design or data manipulation where relevant to the role.
Day 4 — Practise correctness and complexity. For three problems, write edge cases and a complexity target before coding. Compare a straightforward solution with an improved one.
Day 5 — Rehearse the platform. Complete one timed session in the environment closest to the real test. For HackerRank or CodeSignal, practise task triage. For CoderPad, solve aloud with another person. For Codility, inspect constraints before every implementation.
Day 6 — Simulate the full assessment. Use the real duration, chosen language, no unapproved help, notifications off and one sitting. Review mistakes only after time ends. If the round is live, use Rehearsa's Interview Practice to rehearse explaining trade-offs and handling follow-ups; use a coding platform separately to run code.
Day 7 — Light review and logistics. Revisit mistakes, not new topics. Prepare your workspace, charger, stable connection, browser permissions and backup plan. Stop heavy practice early enough to sleep properly.
How to allocate time
For a 60-minute task, a useful default is:
- 0–7 minutes: read, restate and inspect constraints
- 7–15 minutes: choose the approach and write test cases
- 15–42 minutes: implement and run incremental checks
- 42–52 minutes: test boundaries and fix defects
- 52–60 minutes: review complexity, types, return format and submission
For a multi-question assessment, scan every task first. Do not sacrifice two solvable questions to chase one difficult question. Partial progress may matter on some tests, but scoring rules vary, so prioritise complete, tested solutions unless told otherwise.
How to communicate during a live coding interview
Good communication is structured, not constant.
- Before coding: “I understand the goal as… I have two questions about…”
- Choosing an approach: “The simple version is… Its limitation is… I propose…”
- At a decision point: “I am using a set here because…”
- When debugging: “The output suggests the loop boundary is wrong. I will trace the final iteration.”
- After a hint: “That means my assumption about duplicates was wrong, so I will…”
- At the end: “This is (O(n)) time and (O(n)) space. With more time I would add…”
Do not fill every silence. “I am going to think through the edge cases for a moment” is professional and easier to follow than unfinished thoughts.
Technical rounds often include behavioural questions. Prepare concise examples with the STAR Method, and review Hiring Manager Interview Questions with Model Answers.
Mistakes that lower strong results
- Coding before understanding the contract. A fast solution to the wrong problem is still wrong.
- Ignoring constraints. Input size is often the clearest clue to required complexity.
- Trusting the sample only. Samples explain behaviour; hidden cases test understanding.
- Using an unfamiliar language to look impressive. Choose the language in which you can debug reliably, if allowed.
- Writing clever code that cannot be explained. Readability helps you and the reviewer.
- Going silent in a live interview. The interviewer cannot score reasoning they never hear.
- Narrating every keystroke. Explain decisions, not punctuation.
- Rejecting hints. Collaboration and course correction are often part of the assessment.
- Using prohibited assistance. Follow the stated rules on search, documentation, AI tools and communication.
- Leaving no review time. A final check often catches a wrong return type or missed boundary.
For broader interview habits, see 10 Common Interview Mistakes and How to Fix Them.
What to do when you get stuck
Shrink the problem. Work through the smallest valid input by hand. State a brute-force approach even if it is inefficient; it gives you a correct baseline and reveals the repeated work an optimisation must remove.
Then classify the failure:
- You do not understand the prompt: restate it and list one example.
- You cannot find an efficient algorithm: describe the direct solution and identify its bottleneck.
- The code does not work: compare expected and actual state at the first wrong step.
- You forgot syntax: explain the operation, use permitted documentation, or write clear pseudocode temporarily.
- You are out of time: make the core case correct, note limitations and test what you have.
In a live exercise, ask for a minute to think or request clarification. That is better than hiding confusion and producing unrelated code.
Accessibility and technical problems
Request reasonable adjustments before the assessment where possible. This may include extra time, breaks, screen-reader compatibility, a different input method or an alternative format. Ask the recruiter how the adjustment will work on the chosen platform.
If the platform fails, record the error and time without exposing confidential assessment content, then contact the recruiter promptly. Do not repeatedly refresh or start a second attempt unless instructed.
The final checklist
- I know the exact platform and format.
- I have used its practice or sandbox environment.
- I will use my strongest permitted language.
- I know what resources and AI tools are allowed.
- I can explain common time and space complexity clearly.
- I test normal, minimum, boundary and duplicate-value cases.
- I can move from a simple solution to an improved one.
- I have completed one realistic timed simulation.
- My laptop, browser, internet and charger are ready.
- I have a plan for recovering when I get stuck.
Practise the whole technical interview
A coding platform can tell you whether code passes its tests. It cannot fully prepare you to explain a decision, respond to a hiring manager's follow-up, recover from a hint or connect the solution to your experience.
Use HackerRank, Codility, CodeSignal or a CoderPad sandbox to practise implementation. Then use Rehearsa's Interview Practice to rehearse the spoken part: clarifying requirements, explaining trade-offs, answering follow-ups and presenting your solution without rambling.
If a case or system-design discussion follows, read How to Prepare for a Case Study Interview and How to Prepare for a Hiring Manager Interview. You can also compare Rehearsa plans and pricing before choosing how much feedback you need.