Skip to Content
TypeScript Intermediate: Types That Survive Real Projects
Intermediate
0 likes
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

Sign in to save your progress.

Course Home
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?
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?
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 comment

No comments yet.