Exam · TypeScript: types for safer web applications

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

Explain which TypeScript inputs the lab's configuration selects, what happens to older build output after a compiler error, and the order in which you would run the install, check, test and demo commands. State what these commands do not demonstrate.

Compare with a sample answer

The include patterns select the TypeScript files under src and test/types.ts; the runtime test stays ordinary JavaScript. With noEmitOnError, a compiler error prevents new output but leaves older files in build, so stale output must not be run as evidence. Install the pinned dependency (npm install --ignore-scripts --no-audit --no-fund, or npm ci --ignore-scripts once the lockfile exists), run npm run check, then npm test and npm run demo, both of which rebuild before executing. None of these commands demonstrates browser layout, network failure handling or keyboard access.

A good answer separates the compiler inputs, the stale-output risk and the command order, and keeps the limits of the commands explicit.

Practice 2

For the lab's decoder, compare an absent note, note: "" and note: null; compare minutes: 25, minutes: "25" and minutes: 1.5; and describe what happens to an extra admin: true field on an otherwise valid record.

Compare with a sample answer

An absent note and an empty note are both accepted and remain distinct: the absent property stays absent and the empty text is kept, while null is rejected with Invalid note. Numeric 25 is accepted; the string "25" and 1.5 are rejected with Invalid minutes, because durations must be integers from 1 to 240 and are not coerced. The admin field is left out of the newly constructed record, since only recognised fields are copied. None of these decisions establishes user identity or permission to access a course.

A good answer keeps missing, empty and invalid values distinct, refuses coercion and treats the projection as data shaping rather than permission.

Practice 3

Without changing the parser, predict the outcome for malformed JSON, a top-level object, an empty list, a thirteen-row list, a list whose second row has an invalid duration, two rows with the same ID, and one object with two minutes keys.

Compare with a sample answer

Malformed syntax returns Invalid JSON. A top-level object or a thirteen-row list returns Expected at most 12 courses. An empty list succeeds. When the second row has an invalid duration after a valid first row, the whole list fails with Invalid minutes and no partial value is returned. Two rows with the same course ID fail with Duplicate course ID after row decoding, whereas two minutes keys in one JSON object have already been reduced by the parser to the last value and are not separately rejected.

A good answer follows the order of the parser's checks and distinguishes duplicate course IDs from duplicate JSON property names.

Practice 4

In a scratch copy, a loading tag is added to View while statusText is left unchanged. Describe what the compiler reports and why, how the omission is resolved, and what that fix still does not establish.

Compare with a sample answer

The loading variant reaches the default branch, where it cannot be passed to unreachable as never, so compilation fails at that call. Adding a loading branch that returns text resolves the static omission. It does not establish cancellation, request ordering, focus behaviour or status announcements; those need application logic and runtime or browser checks suited to the adapter, such as tests of stale-response ordering.

A good answer links the error to the never parameter and keeps static exhaustiveness separate from asynchronous and browser behaviour.

Practice 5

In scratch copies, remove the duration upper bound, then separately disable exactOptionalPropertyTypes. For each change, say which layer detects it and why, and explain why the faulty parser must still compile.

Compare with a sample answer

Removing the duration ceiling still compiles, because the type only says minutes is a number, so the compiler cannot see it; the runtime test with 241 minutes fails. Disabling exactOptionalPropertyTypes makes the note: undefined example legal, so its expected-error directive is unused and the compiler reports that. Both changes are restored afterwards. The faulty parser must compile, because a failure caused by a syntax typo would come from the compiler and would not show a runtime test catching the broken rule. A compiler pass and a runtime pass are separate pieces of evidence.

A good answer names the runtime 241-minute case, the unused-directive diagnostic and the reason a compiling fault is needed for runtime evidence.

Practice 6

Write a one-boundary migration plan for an existing JavaScript feature: choose the boundary, name what changes together, and list the compiler, runtime and browser checks needed before it ships, without claiming the whole application is converted.

Compare with a sample answer

A suitable first slice is a saved-list JSON reader plus the pure function that turns its result into display state. Record its current success and failure examples, then change a small type, an explicit runtime decoder and the typed caller together. Run the compiler and data tests, then check the real browser adapter for keyboard input, focus, error recovery and status announcements. Record asynchronous ordering or storage failure cases separately, and state in the handover what remains unverified.

A good answer keeps the slice small, adds explicit decoding, keeps behaviour tests and plans real browser checks rather than treating a green build as acceptance.

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, 45 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.