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.