×

Top 30 TypeScript Interview Questions for 2024

1) What is TypeScript?

TypeScript is an object-oriented and compiled language. TypeScript is also known as a set of tools. TypeScript is used for application-scale development.

2) What are the features of TypeScript?

Features of TypeScript are:
  • TypeScript is just same as JavaScript
  • Supports other JS libraries
  • It is portable
  • Here, .js file can be renamed to .ts

3) Who is the inventor of TypeScript?

Designed by Anders Hejlsberg at Microsoft.

4) What are the benefits of TypeScript?

Benefits of TypeScript are:
  • Compilation
  • Strong Static Typing
  • supports type definitions
  • supports Object Oriented Programming

5) What are the components of TypeScript?

There are three components of TypeScript are:
  • TypeScript Language
  • TypeScript Compiler
  • TypeScript Language Service

6) What are the types of comment in TypeScript?

There are two types of comment in TypeScript:
    • Single line.
Example: // Single Line Comment.
    • Multiple line.
Example: /* Multiple Line Comment.*/

7) What is the extension supported by TypeScript?

TypeScript supports .ts extension.

8) What is negation operator?

It is a type of miscellaneous Operator and used to Change the sign of a value. It is denoted by "-" symbol.

9) How to call base class constructor from child class in TypeScript?

By using super().

10) What is the Default Access Modifier for members of a class in TypeScript?

public is the default access modifier for members of a class.

11) Does TypeScript support function overloading?

Yes, Typescript support function overloading.

12) How to generate TypeScript definition File from .ts file?

By using tsc compiler, you can generate TypeScript definition file from .ts file.

13) What are Modules in Typescript?

Modules helps in organizing the code written in TypeScript. Two types of Modules are:
  • Internal Modules
  • External Modules

14) Is it possible to combine multiple .ts files into a single .js file?

yes, It is possible.

15) What is the syntax to declare ambient variables in TypeScript?

The syntax to declare ambient variables:
  1. declare module Module_Name {
  2. declare module Module_Name {
  3. }

16) What is Internal Module in TypeScript?

Internal Module: It is used to logically group classes, interfaces, functions into one unit and can be exported in another module.

17) What is the syntax to declare External Module using export in TypeScript?

The syntax to declare External Module using export is:
  1. //FileName:TutorialandExample.ts 
  2. export interface TutorialandExample {
  3.    //code declarations 
  4. }

18) What is the syntax to declare External Module using import in TypeScript?

The syntax to declare External Module using import is:
  1. import TutorialandExampleRef = require("./TutorialandExample");

19) What is the syntax to declare Internal Module in TypeScript?

What is the syntax to declare Internal Module in TypeScript?
  1. module TutorialandExample {
  2.    export function add(x, y) {
  3.       console.log(x+y);
  4.    }
  5. }

20) What is Nested Namespaces in TypeScript?

Nested Namespaces: we can define one namespace inside another namespace.

21) What is the syntax to declare Nested Namespace in TypeScript?

The syntax to declare Nested Namespace is:
  1. namespace firstnamespace {
  2.    export namespace secondnamespace {
  3.       export class classname {    }
  4.    }
  5. }

22) What is Object in TypeScript?

Object: It is an instance of class which contains set of key and value pairs. Here, the values can be scalar values/functions or array of other objects.

23) What is Duck-typing in TypeScript?

Duck-typing: It is used to verify the presence of certain properties in the objects to check their suitability. Here, two objects are considered to be of the same type if both share the same set of properties.

24) What is the use of this keyword in TypeScript?

this keyword: It refers to the current instance of the class. In this keyword, the parameter name and the name of the class field are the same.

25) What is the use of new keyword?

new keyword: It is used for instantiation in object creation.

26) What are the types of inheritance classified in TypeScript?

The types of inheritance classified in TypeScript are:
  • Single
  • Multiple
  • Multilevel

27) What are the types of access modifiers supported by TypeScript?

The types of access modifiers supported by TypeScript are:
  • Public
  • Private
  • Protected

28) What is the use of pipe symbol in TypeScript?

pipe symbol: It is used to combine two or more data types to denote a Union Type.

29) What is the use of push() and pop() method in Tuple?

push() method: It appends an item to the tuple. pop() method: This method removes and returns the last value in the tuple.

30) What are the variable scopes available in TypeScript?

The variable scopes available in TypeScript are:
  • Global Scope
  • Class Scope
  • Local Scope

Related Topics

Polymer.js Interview Questions

1) What is Polymer.js? Polymer.js is an open source JavaScript library. It is developed by Google. It is used to develop web applications for using of web components like HTML. 2) Describe...

3 minutes read.

Top 15 Xamarin Interview Questions for 2024

1) What is Xamarin? Xamarin is a .NET framework. It allows to create an application that run on multiple platforms. Xamarin Tutorial uses C# language and .NET framework to deliver native...

2 minutes read.

Top 15 VBA Interview Questions for 2024

1) What is VBA? VBA stands for Visual Basic Application. It is an event-driven programming language. It is mainly used with Microsoft Office applications such as MS -Excel, MS-Word and MS-Access. 2)...

3 minutes read.

Top 15 Meteor Interview Questions for 2024

1) What is Meteor or MeteorJS? Meteor is a JavaScript platform used for developing web and mobile applications. Applications develop using Meteor framework supports different platforms (like windows, android, ios). Meteor...

4 minutes read.

Top 15 C Interview Questions for 2024

1) What are different storage class specifiers in C? Register,auto, static, extern are the storage class specifiers in C. 2) What is scope of a variable? How are variables scoped in C? Scope...

3 minutes read.

Top 30 Core Java Interview Questions for 2024

1. What is the difference between HashMap and Hashtable in Java? Ans. S.No. HashMap Hashtable 1. ...

6 minutes read.

Top 15 RESTful Web Services Interview Question for 2024

1) What is REST? REST is web standards based architecture and stands for REpresentational State Transfer. It uses HTTP Protocol for data communication. Here, everything is a resource. 2) What are the HTTP methods used...

2 minutes read.

Top 40 TensorFlow Interview Questions and Answers

Commonly Asked TensorFlow Interview Questions for Fresher Q1. What is TensorFlow? TensorFlow is the machine learning library developed by Google's brain team, it supports multiple abstraction levels, and we can choose the...

13 minutes read.

Top 30 SQL Interview Questions for 2024

1. What is SQL? Ans. SQL stands for Structured Query Language.  It is a standard computer language for accessing, storing, and manipulating data stored in the relational database. SQL become an International Standard Organization (ISO)...

11 minutes read.

Top 15 MATLAB Interview Questions for 2024

1) What is MATLAB? MATLAB (matrix laboratory) is fourth-generation programming language. It allows matrix manipulations, implementations of algorithm and many more. 2) Who developed MATLAB? MATLAB is developed by MathWorks. 3) In which language...

2 minutes read.

Top 27 JavaScript Interview Questions for 2024

1) Define Undeclared and Undefined Variables? Undeclared variable are defined as these variable is neither defined nor exist in the program. If program calls this variable then it causes Runtime error. Undefined variable...

5 minutes read.

Top 30 JSF Interview Questions for 2024

1) What is JSF? JSF stands for Java Server Faces is a Java-Based web application framework. JSF (Java Server Faces) provides a facility to connect UI widgets with data sources. 2) What are...

4 minutes read.

Top 15 Euphoria Interview Questions for 2024

1) What is Euphoria? Euphoria is a programming language. It is open source, powerful and easy to learn. It stands for End-User Programming with Hierarchical Objects for Robust Interpreted Applications 2) Who...

2 minutes read.

Top 30 CSS Interview Questions for 2024

1) Define the process where block elements can be centered with css. It can be centered by using margin-left and margin-right properties we can centered the block level elements. 2) Name the...

4 minutes read.

Top 15 Data structure & Algorithm Interview Questions for 2024

1) What is Data Structure? Data structure is a way of storing, collecting and organizing data into the main memory. It makes data access more efficient and increase performance. Array, List, Queue...

3 minutes read.

Top 15 PouchDB Interview Questions for 2024

1) What is PouchDB? PouchDB is an in-browser database that allows applications to save data. It is an open source database. It runs in Node.js. 2) In which language PouchDB was written? PouchDB was written in JavaScript language. 3)...

2 minutes read.

Top 13 SAS Interview Questions for 2024

1. What is SAS and its functions? SAS (Statistical Analysis System) is statistical software designed by SAS Institute in 1960 for data inspection and report writing. SAS runs on Windows, UNIX...

5 minutes read.

Symfony PHP Framework Interview Questions

1) What is Symfony? Symfony is an open source, web application framework. It is written in PHP and used to design PHP applications. It was first released on18 October, 2005. 2) What...

5 minutes read.

Top 15 XHTML Interview Questions for 202

1) What is XHTML? XHTML (Extensible Hyper Text Markup Language) it is similar to the HTML but has some strict rule than HTML. It is said to be HTML defined as...

3 minutes read.

Top 30 FuelPHP Framework Interview Questions for 2024

1) What is FuelPHPFramework? FuelPHP Framework is an open source web application and written in PHP scripting language. It is based on the HMVC (Hierarchical Model View Controller) design pattern. It was released...

6 minutes read.