TypeScript Interview Questions: TypeScript is an open-source programming language developed and maintained by Microsoft. TypeScript is a superset of JavaScript that compiles to plain JavaScript.

Q: What is TypeScript?
TypeScript is a superset of JavaScript that compiles to plain JavaScript. It is developed and maintained by Microsoft.
You may also like - React.js Interview Questions
Q: Who is the founder of TypeScript?
Microsoft Corporation
Q: What are the types in TypeScript?
There are mainly two types of data types:
- Built-in: This includes number, string, boolean, void, null and undefined.
- User-defined: It includes enums, classes, interfaces, arrays, and tuple.
//Boolean
let isDone: boolean = true;
//String
let name: string = "Full Stack Tutorials";
//Number
let decimal: number = 10;
//Array
let list: number[] = [1, 2, 3, 4, 5];
//Any
let notSure: any = 5;
//Null & Undefined
let u: undefined = undefined;
let n: null = null;
Q: What are the Benefits of TypeScript?
- It helps in code structuring
- Typescript is purely object oriented programming.
- It offers a "compiler" that can convert to JavaScript equivalent code.
- It has a concept of namespace defined by a "module".
- Type checking
- Compile time error checking
- Code completion and intelligence
Q: What are the features of TypeScript?
- tsc --init
- extends in tsconfig.json
- type vs interface
- keyof
- Mapped Types
- Mixin classes
- object vs Object
- Transpiling async/await to ES5/ES3
- String valued enums
- allowJs, checkJs, // @ts-check
Q: How to install typescript using NPM?
npm install -g typescript
Q: How to compile a typescript file via command line?
tsc fileName
//Example
tsc helloworld.ts
Q: What are the Modules in Typescript?
Modules are the way to organize code in TypeScript. Modules contains classes and interfaces. It is same like namespace in C#.
Types of Modules:
- Internal Modules
- External Modules
You may also like - Node.js Interview Questions
Q: What are different components of TypeScript?
There are different types of components of TypeScript:
- Language
- Compiler
- Language Service
Q: Does TypeScript supports function overloading?
Yes, TypeScript does support function overloading but the implementation is a bit different if we compare it to OO languages.