PRACTICE TESTTech and coding
JavaScript coding test practice
A free JavaScript coding practice test: JavaScript concepts, what the code logs, finding the bug and choosing a working solution, in the style of employer coding assessments, each answer explained.
- 10 free questions, no account
- Timed like the real test
- Cancel any time
- Free sample
- 10 questions · 30 min
- Question types
- JavaScript concepts, What the code logs, Finding the bug and more
- Full-length mocks
- The real number of questions and time limit
The short answer
A JavaScript coding test is an online assessment some employers use to check how well applicants read, write and debug JavaScript before an interview. There is no single test: each employer chooses a platform and sets its own questions, length and time limit, and many ask you to write code that is checked against test cases. This free practice test has 10 original questions on reading, tracing, debugging and choosing modern JavaScript and takes about 30 minutes.
- Free sample
- 10 questions in 30 minutes
- Format
- Set by each employer and platform
- Example (HackerRank JavaScript Basic)
- 2 questions in 1 hour 30 minutes
- Coding questions
- Usually scored automatically against test cases
Try it free
10 questions in 30 minutes, at the real pace. Your score and every answer explained at the end.
Choose your plan
Unlock the full practice
JavaScript test: full-length timed mocks, plus every other test
Start the monthly plan- Full-length timed mocks for this test
- An explanation for every question
- Your score by question type, and your history
- All 93 practice tests included
- Works on phone and laptop
7-day refund if you have taken no more than one full mock. Prices in USD.
What's inside the full practice
Full-length mocks in the real format and timing, each with a full review when you finish.
- FreeFree sample10 questions · 30 min
- Full-length mocksThe real number of questions and time limit
- Every question typeJavaScript concepts, What the code logs, Finding the bug and more
- A full reviewYour score by question type after every mock
- Score historyYour progress across attempts
- Phone or laptopPractice wherever you are
- JavaScript concepts90%
- What the code logs75%
- Finding the bug60%
- Building a solution35%
Work on next: building a solution.
Free sample or full practice
| Feature | Free | Full |
|---|---|---|
| Questions in the real style | ||
| Every answer explained | ||
| Full-length timed mocks | ||
| Score by question type | ||
| Score history across mocks | ||
| All 93 practice tests |
Free study guide
Everything to know about the real test, in short lessons.
What the real test usually looks like
There is no single JavaScript coding test. Each employer chooses a testing platform and then sets its own questions, number of tasks, time limit and allowed languages. Your test invitation is the best guide to yours. Public examples show the range:
- HackerRank. HackerRank lists its JavaScript (Basic) skills test as 2 questions in 1 hour 30 minutes, covering topics like functions (HackerRank). Its help center lists the question types an employer can put in a test, including coding, multiple choice, HTML/CSS/JavaScript, front-end developer, code review and subjective questions, and says employers can add questions from HackerRank's library or write their own (HackerRank Help).
- TestGorilla. TestGorilla's JavaScript coding tests page says individual tests range from 15 to 45 minutes, lists an entry-level algorithms test at 15 minutes, says candidates work in an online editor, and says employers choose which languages are available (TestGorilla).
Parts commonly reported in employer JavaScript tests:
- Coding tasks: write a function in an online editor, run it against sample inputs, then submit it to be checked against more test cases you may not see.
- Multiple choice: JavaScript concepts, what a snippet logs, and which code is correct.
- Debugging or code review: find and fix the problem in code someone else wrote.
- Sometimes more: building or fixing a web page, a larger front-end or back-end project, a take-home assignment, or webcam and screen monitoring during the test.
What our mocks cover. Our full mocks have 20 questions in 60 minutes in four sections: JavaScript concepts (6), what the code logs (6), finding the bug (5) and building a solution (3). All code is modern JavaScript as it runs on Node.js, with no browser or framework code. You can go back, change an answer and flag questions until you submit. Our mocks practice reading, tracing, debugging and choosing code. They do not run code you write. Many real assessments do ask you to write code that runs against hidden test cases; this practice builds the reading, tracing and debugging skills behind that, so add some timed practice in a real editor as well. Our mocks also leave out front-end, back-end and full-stack project tasks, proctoring, plagiarism checks, video interviews, take-home tasks and any employer pass mark.
Question types with worked examples
One worked example for each section, with the trap most people fall into.
1. JavaScript concepts. What is the difference between let and var? let is scoped to the nearest block, such as a loop body, and cannot be used before its line runs. var is scoped to the whole function and is hoisted, so it exists as undefined before its line. Trap: assuming const makes an object or array unchangeable. It only stops the name from being reassigned.
2. What the code logs. console.log(typeof null, typeof []) logs object object. Both are objects as far as typeof is concerned; use Array.isArray to check for an array. For async code, remember the order: ordinary code first, then promise callbacks, then timers. Trap: reading setTimeout(fn, 0) as "run now". It always waits until the current code and pending promise callbacks are done.
3. Finding the bug. A function returns undefined instead of a total. Look for an arrow function with braces but no return: (a, b) => { a + b } returns undefined, while (a, b) => a + b returns the sum. Trap: fixing the first line that looks unusual. Trace a tiny input through the code and find the first line where the value goes wrong.
4. Building a solution. You need the total price of a cart. items.reduce((sum, item) => sum + item.price, 0) does it. Without the 0 at the end, an empty cart throws a TypeError. Trap: picking the option that works for the example but not the edges. Check every choice against an empty array, one item, repeats and missing values.
How to prepare
- Read your invitation first. Find out which platform you will use, how many tasks there are, the time limit, whether you can choose JavaScript, whether front-end tasks are included, and whether the test is monitored. Formats vary too much to assume.
- Try the platform's practice area if it has one. Get used to the editor, the Run button and how sample test cases are shown, so the screen is not new on the day. HackerRank, for example, describes candidates clicking Run to run the test cases while they work (HackerRank Support).
- Trace code by hand. For short snippets, write each variable's value after every line. For async code, keep three lists: what runs now, promise callbacks and timers.
- Know the everyday tools. Arrays and their methods (
map,filter,reduce,some,find,sort), objects,MapandSet, strings, destructuring, spread, template literals,asyncandawait. - Think about edge cases before you submit. Empty arrays and strings, one item, repeated values,
nullandundefined, numbers given as strings. Hidden test cases often check exactly these. - Write some code against the clock. Our mocks train reading and debugging. Also solve a few small problems in a real editor with a timer, so writing and running code under pressure feels normal.
- Practice at the real pace. If your test is like HackerRank's JavaScript (Basic) example, 2 questions in 1 hour 30 minutes gives about 45 minutes a problem (HackerRank). Take full timed mocks so pacing yourself feels normal.
How scoring usually works
Scoring depends on the platform and the employer. There is no universal scale and no universal pass mark. Coding questions are usually scored automatically against test cases. Two public descriptions:
- HackerRank says coding questions are evaluated with predefined test cases that measure correctness and efficiency. Each test case has its own score: code that passes a test case receives that test case's full score, and code that fails it receives zero. The question's total is the sum of the test cases passed, so a solution that passes some test cases earns part of the points (HackerRank Support). Coding and multiple choice questions are evaluated automatically, while HTML/CSS/JavaScript questions are evaluated by hand and front-end questions are evaluated automatically with a manual review recommended (HackerRank Help).
- TestGorilla describes percentile-based scoring based on overall correctness and a report showing each test case's result (TestGorilla).
What counts as a good result is up to each employer, and many look at your code as well as the score.
Our practice score is the number of our own questions you answered correctly, with a breakdown by section, so you can see where to focus. It is a practice score: it is not a score on any platform's test and does not predict whether you will pass.
Common mistakes
- Sorting numbers without a compare function.
[10, 9, 1].sort()sorts as text. Usesort((a, b) => a - b). - Using
==and getting surprised by type conversion. Prefer===unless you have a reason not to. - Forgetting that
forEachdoes not wait.awaitinside aforEachcallback does not pause the outer function. Usefor...oforPromise.all. - Comparing objects or arrays with
===. Two objects are equal only if they are the same object. Compare the fields you care about. - Changing an array you meant to keep.
sort,reverseandsplicechange the array in place. Copy it first with[...arr]when you need the original. - Only testing the example. The visible example usually passes. Hidden test cases check empty input, single items, duplicates and large inputs.
- Running out of time on one task. If you are stuck, submit a simple version that passes some test cases, move on, and come back if time allows.
Original practice questions, never real or leaked ones. Cancel the monthly plan any time, and ask for a refund within 7 days if you have taken no more than one full mock.
Frequently asked questions
Is there one standard JavaScript coding test?+
No. Each employer picks a platform and sets its own questions, length, time limit and languages. Your test invitation says what yours includes, and some platforms offer a practice area to try first.
Do your mocks run the code I write?+
No. Our mocks practice reading, tracing, debugging and choosing JavaScript code with multiple choice questions. Many real tests ask you to write code that is run against hidden test cases, so practice writing small programs in a real editor too.
Do your mocks include React, HTML or CSS tasks?+
No. Our questions use modern JavaScript as it runs on Node.js, with no browser, framework or front-end project tasks. If your test includes those, practice them separately.
What score do I need to pass?+
There is no universal pass mark. Platforms score coding questions against test cases, and each employer decides what result moves you forward, often looking at your code as well.
Are these real JavaScript test questions?+
No. These are original practice questions written by our team in a similar style. Intellect Council is not affiliated with HackerRank, TestGorilla or any other testing platform or employer.
Sources
- HackerRank: JavaScript (Basic) skills test page, checked 2026-11-09
- HackerRank Help: Question types in HackerRank tests, checked 2026-11-09
- HackerRank Help: Scoring questions (overview), checked 2026-11-09
- HackerRank Support: Coding question, scoring a coding question in tests, checked 2026-11-09
- TestGorilla: JavaScript coding tests, checked 2026-11-09
Related practice
Practice tests for job seekers
Free timed practice tests for employer tests: aptitude, reasoning, psychometric, Wonderlic-style, CCAT-style and Excel. No account needed to start.
ExplorePython coding test practice
Free Python assessment practice: concepts, what the code prints, finding the bug and choosing a working solution, each traced step by step.
ExploreSQL test practice
Free SQL test practice: concepts, what a query returns, fixing a query and choosing the right one, in portable standard SQL, each traced step by step.
ExploreWalk in prepared.
Leave knowing you did your best.
Timed practice in the real format, with every answer explained.