TypeScript Quiz
Check compile-time versus runtime thinking, unknown boundaries, configuration, and architecture judgments with instant feedback.
Introduction
This knowledge check covers the TypeScript course: erasure, unknown, configuration, APIs, and architecture. Submit each answer for an explanation, then finish for a score.
How to Use This Quiz
Answer every question, read the explanation even when you are correct, then finish for a score. Treat a miss as a pointer back to the matching lesson, not as a trivia failure.
What This Quiz Covers
The mix includes compile-time versus runtime, unknown, configuration, HTTP generics, type guards, and architecture judgments that appear in interviews.
Compile Time Versus Runtime
A correct TypeScript answer names what the checker proves and what JavaScript still does after emit. If you claim a type validates JSON, revisit the compiler and validation lessons.
Trust Boundaries
HTTP, queues, files, and environment variables change origin. Those values start as unknown and become trusted only after runtime validation.
Configuration and Strictness
strict, noUncheckedIndexedAccess, and incremental project references change what the checker assumes. They do not replace tests or parsers.
Architecture Judgments
Shared contracts, catch typing, and check-time performance are design choices. Prefer the smallest public surface that preserves a real invariant.
Scoring and Review
Aim to explain every miss in one sentence that distinguishes a compile-time guarantee from a runtime control. Then retake only the weak areas.
Interview Use
Use these prompts as spoken drills. A staff answer includes a definition, a failure mode, and a production placement.
Quiz
TypeScript knowledge check
16 questions · answer each one and get instant feedback.
1What happens to TypeScript types in emitted JavaScript?
2Which type should you use for untrusted JSON before validation?
3What does HttpClient.get<Course[]>() guarantee?
4When is a string literal union usually better than a numeric enum?
5What does noUncheckedIndexedAccess change?
6Which statement about const is true?
7What is the sound use of a user-defined type guard?
8Why does satisfies exist?
9Where should environment variables be typed?
10What is a trust boundary?
11Which option improves checker performance without dropping safety?
12What should a shared contract package contain?
13How should catch (error) be typed?
14Name the TypeScript type for values that are not yet proven.
Hint: we look for key terms in your answer.
15Which compiler flag bundle enables noImplicitAny and strictNullChecks together?
Hint: we look for key terms in your answer.
16Write the type predicate return type for a function that proves value is a string.
Hint: we look for key terms in your answer.