Free · no sign-up · JavaScript and Python

Coding test practice: write it, test it, beat the clock

Practice for the online assessment the way it really works. Pick one of 74 classic problems, grouped by 15 patterns, and write your own solution from an empty function in a real code editor. Run it on the examples, then submit it against hidden tests and a large test with a time limit. Hints come one step at a time, a walkthrough explains every problem from the slow idea to the fast one, and solved problems come back for review.

Start practicing

74 problems

Language: Python loads only when you pick it.

Your roadmap: 15 patterns, in study order

Arrays and hashing 6 problems

Two pointers 5 problems

Sliding window 5 problems

Stack 5 problems

Binary search 5 problems

Linked list 5 problems

Trees 7 problems

Heap and top K 4 problems

Intervals 4 problems

Greedy 4 problems

Backtracking 5 problems

Graphs 6 problems

1-D dynamic programming 6 problems

2-D dynamic programming 4 problems

Tries and design 3 problems

Your code and progress are saved in this browser. The optional AI buttons send the problem and your code to ClapAssist, which saves them to your history; see or delete it at My Data.

How to practice a coding test on this page

  1. Pick a problem. Press Start with problem 1, or choose any problem from the list. The list runs from easy to hard inside each pattern, so working down it is a study plan. Filter by pattern, level or status, or search by name.
  2. Write your own solution. The editor opens with an empty function that has the right name and inputs, never the answer. It colors the code, closes brackets, matches pairs and indents for you; Ctrl+F (Cmd+F on a Mac) searches. Choose JavaScript or Python above the editor. Keep the function name: the tests call it. Above the hints, the target line says how fast a good answer is, for example "time O(n); space O(1)".
  3. Press Run examples. The results show, for each example, the input, the expected output, your output, anything you printed and the time it took. Press Your own test to try an input of your own; the expected answer comes from our reference solution.
  4. Press Submit. Submit runs the examples, the hidden tests and, on most problems, a large test. Each test has a time limit: 3 seconds in JavaScript, 8 in Python. A problem counts as solved when every test passes.
  5. Stuck? Open one hint at a time. Hint 1 points at the idea, hint 2 at the key condition or data structure, hint 3 at the steps. Stop at the first hint that unblocks you. If the hints are not enough, the optional Stuck? button asks an AI to read your code and suggest one next step, not the answer. Show the walkthrough and solution asks once before it opens.
  6. Read the walkthrough. Every problem has the same five parts: the slow way first and why it is slow, the better idea, a dry run of the better idea on Example 1, the mistakes people make on that problem, and the time and space cost. Then the code in your language.
  7. Come back for reviews. A solved problem returns 1, 3, 7 and 21 days later. Solve it again from an empty starter, without hints. The list page shows what is due today.
  8. Then take a timed test. Press Take a timed test, pick 2, 3 or 4 problems, and the clock starts. It stays at the top of the screen while you scroll and turns to a warning color in the last five minutes. You get a score, and the time you spent on each problem, when you press End test or time runs out.

What a real online assessment looks like

An online assessment (OA) is the timed coding test many employers send before the interviews. The platforms differ in the details, but the shape is the same, and this page copies it.

Sources, read on 3 October 2026: HackerRank candidate help, "Answer coding questions" and "Hidden test cases"; HackerRank support, "Scoring a coding question"; CodeSignal help center, "What should I expect when I take the General Coding Assessment (GCA)".

The 12 Algorithmic Patterns You Actually Need

1. Two Pointers & Sliding Window

Used for array and string questions to reduce quadratic O(N^2) searches down to linear O(N) by tracking left and right boundaries dynamically.

2. Monotonic Stack & Queue

The secret weapon for "next greater element", temperature lookaheads, and histogram rectangle problems where previous elements must be remembered in strict order.

3. Dynamic Programming Substructure

Coin Change, Longest Common Subsequence and 0/1 Knapsack all follow the same plan: define the answer for a smaller input, write the state transition (how a bigger answer is built from smaller ones), then fill simple tables from the bottom up.

4. Binary Search on the Answer

Not only for sorted arrays. When the question asks for the smallest speed, capacity or day that works, and a bigger value always works too, search that range and test the middle each time.

5. Hash Maps and Prefix Sums

Counting, grouping and "find a pair that adds to K" questions. Store what you have seen so each check is one lookup. A running total turns "sum of any subarray" into a subtraction.

6. Breadth-First and Depth-First Search

Grids, trees and graphs. Use BFS when the question asks for the shortest number of steps; use DFS or recursion to explore every path, count islands or check whether two nodes connect.

7. Heaps and Top K

"The K largest", "the K closest" or "merge K sorted lists". Keep a heap of size K so you never sort everything; each new item costs one push or pop.

8. Intervals

Meeting rooms, merging time ranges, inserting a new booking. Sort by start time first, then walk once and compare each range with the last one you kept.

9. Backtracking

Every subset, permutation or combination, and puzzles like N-Queens. Choose, go deeper, undo the choice. Cut a branch early as soon as it cannot lead to an answer.

10. Topological Sort

Course schedules and build orders: tasks that must wait for other tasks. Count what each task waits on, start with the ones that wait on nothing, and a leftover task means a cycle.

11. Union-Find

"How many groups are connected?" and "does this new edge make a loop?". Join items into sets and ask which set an item belongs to, in almost constant time.

12. Tries

Prefix questions: autocomplete, word search in a grid, "does any word start with this". Store words letter by letter so shared beginnings are stored once.

A worked example: a right idea that still fails

For problem 1, Pair with a target sum (often called Two Sum), we wrote a quick brute force first: two nested loops that try every pair and return [i, j]. Run examples gave All examples passed. Submit passed the three examples and all four hidden tests, then stopped with Time limit exceeded on the large test.

The large test has 200,000 numbers, and the only pair that works sits at the very end. Two nested loops try about 20 billion pairs before they reach it, far more than 3 seconds allow. The fix is the one-pass answer from the hints: a map of the numbers already seen, so each number needs one lookup. It passed the same large test in a few dozen milliseconds in our run. That is also the answer an interviewer wants to hear, because the limits allow 200,000 numbers. Right answers on small inputs are not enough: check the Big-O against the limits yourself before you call a problem done.

Why solved problems come back after 1, 3, 7 and 21 days

Solving a problem once, with the hints open, is not the same as being able to solve it in a test a month later. People forget a solution quickly when they never use it again, and the cheapest fix is to try it again from memory just as it starts to fade, then wait longer before the next try. That is why this page brings a solved problem back after one day, then three, then seven, then twenty-one.

A review starts from an empty starter. If you solve it, the next gap is longer; after the 21-day review the problem is treated as learned and stops coming back. If you give up and open the solution during a review, the gaps start again from one day. The reviews due today sit at the top of the problem list, oldest first, and the progress file you can save keeps them.

What each result means

Why code passes the examples but fails on Submit

Checklist for the day of an online assessment

Most assessments are followed by a live round where you explain your code. Practice saying the approach out loud with the AI mock interview, and look through the software engineer interview questions people report for one large employer to see how coding and behavioral rounds mix.

Frequently Asked Questions

Should I practice in JavaScript, Python, or Java?

Choose the language you are most comfortable with, and the one you will use on the test; most test platforms let you choose. Python is popular for its concise syntax. This page runs JavaScript and Python. If your test will be in Java or C++, use the problems, hints and complexity notes here, then write the same solution in that language on your test's own practice page.

How should I prepare for a timed 70-minute OA?

Take the 4-problem, 70-minute timed test here a few times. Read every problem first, since all are open from the start. Spend the first minutes of each one clarifying inputs, limits and edge cases, think through the brute force approach in your head, and identify the pattern. Solve the easiest cleanly, then the two medium ones, leaving the rest of the time for the hard one. Submit each problem as soon as it passes.

Where can I manage my saved practice code?

Your code is kept in this browser's storage as you type, one copy per problem and language, and comes back when you reopen the problem. So are your solved marks, hints opened, review dates and your last 10 timed tests. Practicing saves nothing to ClapAssist. Under the problem list you can save it all to a file, load that file elsewhere, or delete it; Reset to the starter deletes one problem's copy. If you press one of the optional AI buttons, the problem and your code are sent to ClapAssist and saved to your history, which you can see and delete at My Data.

Which programming languages can I run here?

JavaScript and Python 3, both inside your browser; your code is not sent to a server to compile or run it. JavaScript runs in a Web Worker. Python uses Pyodide, a build of Python for the browser, which downloads from cdn.jsdelivr.net the first time you pick Python and is then kept by your browser. Nothing loads for Python until you choose it. The code editor itself loads when you open your first problem.

What happens when the OA timer reaches zero?

The test ends, like a real one. Every problem whose code changed since its last Submit is submitted automatically, and you get the summary: tests passed per problem, the result for each, and the time used. Then each problem opens for review with its hints and solution. Pressing End test does the same before time runs out.

What are hidden test cases?

Tests you cannot see before you submit. Platforms such as HackerRank show two or three sample cases and keep the rest hidden, so your code is checked on edge cases and large inputs you did not think of. Here each problem has hidden tests and, on most problems, one large test. After Submit you see a failed hidden input, so you can learn from it.

Why does my code pass the examples but fail on Submit?

Usually one of three reasons. An edge case: an empty list, one item, repeats, negative numbers or the largest value in the limits. A slow approach: a nested loop that is fine on 5 numbers times out on 100,000. Or the output format: wrong order, positions that start at 1 instead of 0, or a list where one number was expected.

What does Time limit exceeded mean here?

One test ran longer than 3 seconds in JavaScript or 8 seconds in Python, so the page stopped your code. Your browser tab keeps working, even with an endless loop, because the code runs in a separate worker. On the large test it almost always means the approach is too slow; elsewhere, look for a loop that never ends.

What do the AI buttons do, and what is saved?

Two buttons are optional. Stuck? sends the problem and the code in your editor, and the AI answers with one next step, not the solution. Why does this test fail? appears under the first failed test after a run; it sends that test's input, the expected output, your output and your code, and the AI points at the line or idea that breaks. Your code still runs only in your browser. What you send and the answer are saved to your ClapAssist history so our tools can fill things in for you; you can see and delete them at My Data. The written hints and walkthroughs work without the AI.

Are these the real questions companies use?

No. They are classic problems that teach the patterns online tests are built on, written in our own words, with their common names shown so you can look them up. We do not tag problems with company names, because we have no source we could show you for which company asks what.

Is this coding test practice free?

Yes. All 74 problems, the hints, the walkthroughs, the solutions, Python, the reviews and the timed tests are free, with no account and no limit. The two optional AI buttons are free too, within a daily limit per connection. The hints and walkthroughs are written by us and are the same for everyone.

Next, after the coding test

For the live round

Practice is done. The live round is next.

In a live coding round, someone is watching and asking follow-ups. ClapAssist is an AI interview assistant for Mac and Windows. It reads the problem on your screen, listens to the call, and shows you an approach and code you can talk through. It is hidden from screen share on every plan, including Free; only you can see it.

Download with 10 free minutes
Mac and Windows · No card needed for the free minutes