TypeScript adds one thing to JavaScript: a checker that reads your code before it runs and refuses what it can prove is wrong. Then it removes every type and hands over plain JavaScript. Most of what a TypeScript developer needs to know follows from that split: which mistakes the compiler catches, which it cannot see, and what the program does once the annotations are gone. The TypeScript (Basic) test examines both halves. Some questions show a few lines and ask whether they compile; many show a short program and ask exactly what it prints.
It suits anyone who has written TypeScript for a few months, in a frontend project, a Node.js service or practice problems, and wants a credential that shows they understand the types they write rather than adding annotations until the red underlines go away. The multiple-choice section comes first; a few of its questions ask you to select every correct option, and only the exact set scores. A coding section follows, with a problem to solve in TypeScript against hidden test cases.
What each topic examines
Each area below is a topic on your result, so a weak one shows up by name.
- Basic types and inference. Annotations, what the compiler infers when you leave them out, and why
const n = 10has the type10whilelet m = 10hasnumber. Arrays and tuples, and the three special types:anyswitches checking off,unknownmakes you check before you use a value, andneverhas no values at all. - Unions and narrowing. Writing a union such as
string | number, and howtypeof,in,instanceof, equality and truthiness checks narrow it inside a branch. Expect to say what type a value has at a given line, and to know the traps:typeof nullis"object", and a truthiness check throws away0and""along withundefined. - Interfaces and type aliases. Optional and
readonlyproperties, index signatures,extendsagainst&, what only a type alias can name, and structural typing: why an object literal with an extra property is an error while the same object held in a variable is not. - Function types. Optional, default and rest parameters, return types and
void, and function types such as(a: number, b: number) => number, including which functions may be assigned to one. - Classes and modifiers.
public,private,protectedandreadonly, parameter properties,staticmembers, abstract classes andimplements. - Generics. Functions, interfaces and classes with a type parameter, how
Tis inferred from the arguments or given explicitly, and why the body of a generic function cannot assume anything aboutT. - Enums and literal types. How numeric enum members are numbered, the reverse mapping they get at runtime, string enums (which get none), and literal types and unions of them.
- Types at runtime. What the emitted JavaScript contains: interfaces and type aliases vanish, enums and classes remain,
privatehides nothing from running code, andasconverts nothing. - Modules and compiler options. Default and named imports and exports, the difference between a script and a module, what
targetchanges in the output, and the fact thattscstill writes JavaScript when it reports a type error.
How to prepare
Keep a scratch file open with strict turned on and test yourself against the compiler. Before you save, decide which lines will be underlined and why; before you run, write down what the program will print. When you were wrong, find the rule that explains it before moving on. A rule you looked up after a wrong guess is easier to remember than one you only read about, and it is the habit the test rewards.
Then read the compiler's output. Compile a file holding an enum, a class with parameter properties, an interface and a type alias, and open the JavaScript that comes out. Seeing which declarations leave code behind, and what a numeric enum turns into, settles most runtime questions faster than any explanation.
The JavaScript study plan includes a TypeScript preview module on erased types and inference, interfaces and structural typing, generics, narrowing and tsconfig, with exercises checked on a judge. Its earlier modules on values and types, functions and scope, and prototypes and classes cover the JavaScript underneath, which the output-prediction questions lean on.
For the coding section, solve easy problems from Arrays, Strings and Hash table in TypeScript; the roadmap lessons on arrays and hashing explain the techniques those problems use. Annotate parameters and return types as you would at work, but keep the code plain: the judge checks the value your function returns, not how elaborate its types are. Pasting into the editor is switched off during a sitting, so practise writing solutions from an empty function.
What trips people up
Most lost marks come from a few habits rather than from gaps in knowledge.
- Expecting types to exist at runtime. An annotation neither checks nor converts data. A value from
JSON.parsetyped asUseris whatever the JSON held, andinput as numberleaves a string a string. When a question asks what a program prints, read the JavaScript and ignore the types. - Mixing up compile-time and runtime protection.
privateandreadonlystop code compiling; they do not stop a value being read throughanyor changed through another reference to the same object. - Forgetting widening. A
let, and every property of an object literal, widens"dark"tostringand10tonumber. That is why aletholding"dark"cannot be passed where"light" | "dark"is required, while aconstcan. - Reading the declaration, not the narrowed type. Inside a checked branch a value has a narrower type than its declaration says, and after an early
returnthe rest of the function sees only what is left. - Rushing the multi-answer questions. "Select all that apply" questions score only when the whole set is right, so decide each option on its own before you look at what you have chosen. There is no negative marking, so never leave a question blank.
What changes at Intermediate
The TypeScript (Intermediate) test assumes everything here and moves to the type-level features: generic constraints, keyof and indexed access types, mapped, conditional and template literal types, the built-in utility types, overloads, user-defined type guards, satisfies and as const, and what each strict flag turns on. Its coding section reaches medium difficulty. If the questions here felt routine, that is the next step; all the skill tests are listed on the skill tests page.