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.