Exam · Node.js: build and test a small API

Take the exam and earn your certificate.

A real, server-scored exam for this course. Score strictly above 80% to pass and get a genuine, verifiable certificate.

Before you start

We ask for your name and email first, the same as a PDF download, so we know you are here and your certificate can carry the right name.

We privately record your name, email and request IP for this exam request. Read the privacy notice and retention policy.

Visit Mickai on LinkedIn

Complete the security check before submitting.

Cloudflare Turnstile helps prevent automated submissions. How this check uses data.

You can retake the exam any time. Each attempt draws a fresh set of questions.

Written practice, ungraded

Write your response in your own notes, then compare it with the sample answer. This practice is separate from the scored exam and does not affect your certificate.

Practice 1

Write a compact request and response contract for the fictional catalogue. Include one valid empty search, an unknown route and an unsupported method, and explain why their outcomes differ.

Check your answer against these points:

  • Distinguishes valid empty selection from unknown route.
  • Distinguishes unknown route from unsupported method on a known route.
  • Names the fictional fixture and read-only boundary.
Compare with a sample answer

A valid search that matches nothing returns status 200 with an empty list because the request was understood. An unknown route returns 404. POST to the known catalogue route returns 405 with Allow: GET, HEAD. The fixture is invented and the service is read-only.

Ungraded paper practice. It checks whether route, method and selection outcomes are kept distinct.

Practice 2

Prepare a short query-validation checklist for a reviewer. Use level=3x, level=3&level=3, admin=true, q= and a query containing 81 code units. State which inputs the lesson rejects and why.

Check your answer against these points:

  • Rejects malformed level text before conversion.
  • Rejects repeated and unknown fields.
  • Applies the raw q length limit before trimming.
  • Distinguishes empty q from invalid q.
Compare with a sample answer

Reject level=3x because it is outside the one-digit 1-to-4 grammar. Reject a repeated level and the unknown admin field. Reject q longer than 80 JavaScript UTF-16 code units before trimming. q= is valid and becomes an empty string, which matches all fixture titles.

Ungraded paper practice. It checks query grammar and rejection reasons from the frozen course.

Practice 3

Explain how the response helper should set Content-Length for the serialised JSON and what it should send for HEAD. Give one reason JavaScript string length may differ from encoded response bytes.

Check your answer against these points:

  • Measures encoded bytes after serialisation.
  • States that HEAD has headers and no response body.
  • Explains why non-ASCII text can change byte length.
Compare with a sample answer

Serialise the response body, then measure its UTF-8 byte length with Buffer.byteLength. For HEAD, send the corresponding representation headers and end without a body. Non-ASCII text such as an accented title makes the byte and string lengths differ.

Ungraded paper practice. It checks the response representation and HEAD boundary described in the source.

Practice 4

Trace these requests through the handler order: POST /missing, POST /api/courses, GET /api/courses?level=3x and a selector that throws an unexpected error. Record the status or stable error result and the relevant boundary.

Check your answer against these points:

  • Applies route lookup before method checking.
  • Distinguishes 404 from 405.
  • Maps InputError to 400 invalid_query.
  • Maps unexpected errors to a generic 500 response.
Compare with a sample answer

POST /missing is 404 because route lookup precedes method checking. POST /api/courses is 405 with Allow: GET, HEAD. The malformed level reaches the selector and becomes 400 invalid_query. An unexpected selector error becomes a generic 500 internal_error without exposing its internal message.

Ungraded paper practice. It checks how the handler isolates caller errors from unexpected failures.

Practice 5

Draft a startup checklist that accepts one valid PORT value, rejects two invalid examples, and explains the network boundary and one possible operating-system bind failure.

Check your answer against these points:

  • Names the default and an in-range decimal value.
  • Rejects malformed or out-of-range values.
  • States loopback binding.
  • Does not treat syntax validation as proof that binding will succeed.
Compare with a sample answer

If PORT is absent the lab uses 3000. A value such as 3001 is valid. Empty text and 3e3 are rejected by the declared syntax; 65536 is above the limit. The server binds to 127.0.0.1. Even a valid port may fail to bind when another process is using it or permissions differ.

Ungraded paper practice. It checks only the configuration and local binding described in the frozen lesson.

Practice 6

Write a handover note with two tested facts and at least four limits that remain outside the lab. Explain what evidence another learner should record before extending it.

Check your answer against these points:

  • Separates tested behaviour from intended future features.
  • Lists at least four out-of-scope capabilities.
  • Requests actual runtime and test evidence rather than assumed results.
  • Does not claim access to the live catalogue.
Compare with a sample answer

The lab serves a three-record fictional catalogue on 127.0.0.1 and checks a local HTTP contract with Node built-ins. Record the runtime actually used, commands, test output and error behaviour. It does not establish public hosting, authentication, writes, persistence, load tolerance or dependency readiness. These are limits, not delivered features.

Ungraded paper practice. It checks that evidence and scope limits are reported separately.

About this exam

Is this exam graded?

Yes. Every question is scored on our server, never in your browser, and you need a score strictly above 80% to pass. The questions are a real, reviewed bank for this course, drawn fresh for each attempt.

Is it only multiple choice?

Yes. This is a multiple-choice knowledge assessment, with at least one question from each chapter in every attempt. Written exercises are separate practice and are not automatically scored. Passing does not establish practical professional competence or independently verify identity.

Is there a time limit?

Yes, 30 minutes, shown as a countdown once you start. If time runs out, whatever you have answered is submitted automatically.

Do I need to download the PDF first?

No. This course's full text is on its own page, so you can read it online and come straight here when you feel ready.

What do you do with my name and email?

We privately record your name, email, request IP, course and privacy acknowledgement for this request. Newsletter consent is separate and optional. See /privacy.html for storage and retention. A passed exam creates a server-stored named certificate. An email confirmation is not identity assurance.

Can I retake it if I fail?

Yes, straight away. Each attempt draws a fresh set of questions and shuffles the answer order, so it will not be identical to your last attempt, and an attempt can only be submitted once.

Is the certificate real?

It is a genuine, server-issued certificate with its own verification page and a unique ID, not a self-declared one. It records that you passed this course's exam on this date. It is not an accredited qualification, a professional licence or proof of employment.