Courses
TypeScript Intermediate: Types That Survive Real Projects
Final Check: TypeScript Intermediate
Fifteen scenario questions across the whole course. If you get twelve or more right, you can use generics, utility types and third-party typings in a shared codebase.
Course content
Join this Course
Sign in to save your progress.
-
Generics Without the Fog
-
Generic Functions That Keep the Input Type
-
Generic Types for Lists, Results and Caches
-
-
-
Types That Transform Other Types
-
Utility Types: Partial, Pick, Omit and Record
-
Mapped Types You Can Actually Read
-
-
-
Working With Code You Didn't Write
-
@types Packages and When DefinitelyTyped Is Wrong
-
Typing fetch JSON Without Lying to Yourself
-
-
-
Classes and Modules in TypeScript
-
Classes With public, private and protected
-
Modules, Exports and Avoiding Circular Types
-
-
-
Strictness That Pays Off
-
unknown vs any and Safe Parsing
-
Discriminated Unions for API Responses That Vary
-
-
- Final Check: TypeScript Intermediate
1.
A function is declared with a type parameter T, takes an array of T and returns T or undefined. You call it with an array of strings and then call toFixed on the result after checking it is not undefined. What happens?
2.
A cache is made by a function with a type parameter V that holds a Map from string to V. It has a get method that returns V or undefined. Why is undefined part of the return type?
3.
A generic type Box has a type parameter T with a default of string. You write const note: Box with no angle brackets. What type does it have?
4.
Which description of Pick of Product with the keys id and name is correct?
5.
You write a mapped type with the key K in keyof T, then as a template string that starts with get and capitalizes the key name, and the value is a function that returns T indexed by K. What does it build for a type with a name property?
6.
A library has no types of its own, and npm has no types package for it. You want the compiler to stop complaining quickly. What does a declare module line with only the library name do?
7.
Where should an @types package go in package.json, and why?
8.
An update helper types its changes parameter as Partial of Product. A caller passes an empty object. What does the compiler do?
9.
Why is a cast like as Settings on the result of JSON.parse a problem, even if it compiles?
10.
A function parses text into settings and returns a Result with an ok flag. On success it builds a fresh object from the checked fields. What is the benefit over returning the parsed object?
11.
Two classes hold a balance, one with the private keyword and one with a hash prefix. A script uses bracket notation on the word balance for both. What does it get?
12.
A types-only file is imported with the inline type keyword inside braces, and verbatimModuleSyntax is on. The imported module prints a message when it loads. What happens when the program runs?
13.
An object with a method property set to the word POST is declared as a plain constant and passed to a function that wants the literal union GET or POST. The compiler refuses. Why?
14.
A function returns an object with an optional data property and an optional error property, and callers keep writing outcome.data with an exclamation mark. What is the best change?
15.
A barrel file contains only export type lines that re-export names from another module, and the other module prints a message when it loads. What happens when a program imports the barrel?
About
Fifteen scenario questions across the whole course. If you get twelve or more right, you can use generics, utility types and third-party typings in a shared codebase.
- Duration
- 15 min
- Last update
- 10/10/2026
Was this helpful?
0
0
Comments (0)
Sign in to commentNo comments yet.