TypeScript Interview Questions

Home >> Interviews >> TypeScript Interview Questions
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.
Typescript Interview Questions
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 built-in types in TypeScript?
  1. Number
  2. String
  3. Boolean
  4. Null
  5. Undefined
Q: What are the Benefits of TypeScript?
  1. It helps in code structuring
  2. Typescript is purely object oriented programming.
  3. It offers a "compiler" that can convert to JavaScript equivalent code.
  4. It has a concept of namespace defined by a "module".
  5. Type checking
  6. Compile time error checking
  7. Code completion and intelligence
Q: What are the features of TypeScript?
  1. tsc --init
  2. extends in tsconfig.json
  3. type vs interface
  4. keyof
  5. Mapped Types
  6. Mixin classes
  7. object vs Object
  8. Transpiling async/await to ES5/ES3
  9. String valued enums
  10. 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

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:

  1. Internal Modules
  2. 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:

  1. Language
  2. Compiler
  3. 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.

You May Like to Buy Now!