Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

What is the form associated with expression?

Answer»

What is the form associated with expression?
Choose the correct OPTION from below LIST
(1)CONSTRUCTORS
(2)DECORATORS
(3)None of the options
(4)Module initialisation

Answer:-(2)Decorators

2.

Annotations can be implemented as __________.

Answer»

Annotations can be implemented as __________.
CHOOSE the correct OPTION from below list
(1)VAR lengthC='1'
(2)LENGTH: NUMBER
(3)static length=12
(4)length=12

Answer:-(2)length: number

3.

The following are ways to declare a variable in TypeScript, except ________.

Answer»

The following are ways to declare a VARIABLE in TypeScript, EXCEPT ________.
Choose the correct option from below list
(1)var 2
(2)var localLength=13
(3)var lengthA:string = "METER"
(4)var lengthB:string

Answer:-(1)var 2

4.

A type system is a set of ________.

Answer»

A TYPE system is a set of ________.
Choose the correct option from below list
(1)Predefined FUNCTIONS
(2)DATA
(3)VARIABLES
(4)Rules

Answer:-(4)Rules

5.

Type Annotations allow us to _______.

Answer»

Type Annotations allow us to _______.
Choose the CORRECT option from below list
(1)Reassign the type of data
(2)Cast a reference of a base class to ONE of its DERIVED classes
(3)Record the intended CONTRACT of the function or variable
(4)Cast to a supertype

Answer:-(3)Record the intended contract of the function or variable

6.

Which of the following code snippets is safer?

Answer»

Which of the following code SNIPPETS is safer?
Choose the correct OPTION from below list
(1)function FN(x: () => any) { x(); }
(2)function fn(x: () => void) { x(); }

ANSWER:-(2)function fn(x: () => void) { x(); }

7.

Enum organizes a _______.

Answer» ENUM organizes a _______.
Choose the correct option from below LIST
(1)Set of RELATED VALUES
(2)Set of un-related values

Answer:-(1)Set of related values
8.

How can we access a class from a module from outside?

Answer»

How can we access a class from a module from outside?
Choose the correct OPTION from below list
(1)By USING export
(2)By using module
(3)By using namespace
(4)By using import

Answer:-(1)By using export

9.

The following types are supported by TypeScript, except ______.

Answer»

The FOLLOWING types are SUPPORTED by TypeScript, EXCEPT ______.
Choose the correct option from below list
(1)enum
(2)INTEGER
(3)boolean
(4)string

Answer:-(2)integer

10.

A JavaScript file cannot be renamed to a TypeScript file.

Answer»

A JavaScript file cannot be renamed to a TypeScript file.
Choose the CORRECT OPTION from below list
(1)False
(2)True

Answer:-(1)False

11.

What type of checking does Java programming language use?

Answer»

What type of checking does Java programming LANGUAGE USE?
Choose the CORRECT OPTION from below list
(1)Dynamic type checking
(2)STATIC type checking

Answer:-(2)Static type checking

12.

Which of the following demonstrates function overloading, if possible, in TypeScript?

Answer»

Which of the FOLLOWING demonstrates function overloading, if possible, in TypeScript?
Choose the correct option from below LIST
(1)if (value && typeof value == "NUMBER"){}
(2)GET len():string
(3)var f = 0;
(4)var a = function (n1: number, N3?: number) : number{}

Answer:-(1)if (value && typeof value == "number"){}

13.

TypeScript provides access to private members through ___________.

Answer»

TypeScript provides access to private members through ___________.
Choose the correct option from below list
(1)finally block
(2)get and set
(3)TRY and catch block
(4)set only

Answer:-(2)get and set

14.

TypeScript is a __________.

Answer» TYPESCRIPT is a __________.
Choose the correct OPTION from below list
(1)New version of JavaScript
(2)Compiler
(3)Dynamically type-checked language
(4)Super-set of JavaScript

Answer:-(4)Super-set of JavaScript
15.

Code to read JSON object in typescript?

Answer» CODE to READ JSON object in typescript?
We USE let keyword of typescript to handle the JSON VALUE and then parse them. Below is the syntax to handle the JSON value:-


JSON let
16.

TypeScript is __________.

Answer» TYPESCRIPT is __________.
CHOOSE the correct option from below LIST
(1)Procedural
(2)Object Oriented
(3)Symbolic
(4)Functional

Answer:-(2)Object Oriented
17.

How can we access a class of module from outside?

Answer»

How can we access a class of module from outside?
Choose the correct option from below LIST
(1)By using export
(2)It is not POSSIBLE in TypeScript DUE to safety concerns
(3)By using IMPLEMENTS
(4)namespace classToBeExported{}

Answer:-(1)By using export

18.

Type System is a _____________.

Answer»

Type SYSTEM is a _____________.
Choose the correct option from below list
(1)Compiler
(2)SET of rules
(3)PROGRAMMING LANGUAGE
(4)Scripting Language

Answer:-(2)Set of rules

19.

Dynamic type checking is done at __________.

Answer»

Dynamic type checking is DONE at __________.
Choose the CORRECT option from below list
(1)COMPILATION time
(2)RUN time

Answer:-(2)Run time

20.

_________ in the command line enables experimental support for decorators.

Answer»

_________ in the command LINE ENABLES EXPERIMENTAL support for decorators.
Choose the correct OPTION from below list
(1)"experimentalDecorators": true
(2)"TSC --target ES5 --experimentalDecorators"
(3)"compilerOptions": {}
(4)"target": "ES5"

Answer:-(2)"tsc --target ES5 --experimentalDecorators"

21.

During compilation, TypeScript code gets converted to assembly language.

Answer»

During COMPILATION, TYPESCRIPT code gets converted to assembly language.
Choose the correct option from below list
(1)TRUE
(2)FALSE

Answer:-(2)False

22.

Which of the following is the right way of defining enum?

Answer»

Which of the following is the RIGHT way of defining enum?
CHOOSE the correct option from below LIST
(1)declare enum Enum {}
(2)CONST enum DNA {}
(3)enum Enum {}
(4)All the options

Answer:-(4)All the options

23.

What is true about Mixins in TypeScript?

Answer»

What is true about Mixins in TypeScript?
Choose the correct option from below LIST
(1)All the OPTIONS
(2)They are mixed TOGETHER to form a NEW class
(3)They are PARTIAL classes
(4)Each class is focused on a particular activity

Answer:-(1)All the options

24.

The optional parameter can be defined by using "?".

Answer»

The optional parameter can be DEFINED by using.
Choose the CORRECT OPTION from below list
(1)False
(2)True

Answer:-(2)True

25.

We can rename a .js file to .ts file generally.

Answer»

We can rename a .JS file to .ts file generally.
Choose the correct option from below list
(1)FALSE
(2)TRUE

Answer:-(2)True

26.

Accessing a class of a module from outside is impossible in TypeScript.

Answer» ACCESSING a class of a module from outside is IMPOSSIBLE in TypeScript.
Choose the correct option from below list
(1)TRUE
(2)FALSE

Answer:-(2)False
27.

TypeScript is a open secure programming language.

Answer»

TypeScript is a OPEN secure programming language.
Choose the correct option from below LIST
(1)True
(2)False

Answer:-(1)True

28.

The value of TypeScript is writing _________.

Answer»

The value of TypeScript is writing _________.
CHOOSE the CORRECT OPTION from below list
(1)Safer code
(2)LESS code

Answer:-(1)Safer code

29.

Below are the two main ways to install Typescript

Answer»

Below are the two main ways to install Typescript
(1)First way is via NPM(Node.js package Manager) which is command line tool. And below is the SYNTAX or command for install Typescript.
npm install -g typescript

(2)SECOND way is by installing Typescript by the visual studio.
Note:-if we have visual studio or VS code IDE we can easiest way to add to VS or VS code is to SEARCH and add a package or download from typescript WEBSITE. We can download TypeScript tools for VS.

30.

We can rename a .js file to .ts file generally

Answer»

We can rename a .js file to .ts file generally
Choose the CORRECT OPTION from below list
(1)True
(2)False

Answer:-(1)True

31.

Ten most common difference between Javascript and Typescript

Answer»

Ten most common difference between Javascript and Typescript
Below are the 10 most common difference between JavaScript and TypeScript
(1)FIRST Release
(i)Javascript was developed by the Netscape in year 1995
(II)Typescript comes into picture in year 2012 and devloped by Anders Hejlsberg
(2)File Extension
(i)Javascript file name is end with ".js" extension
(ii)Typescript file name is end with ".ts" extension
(3)Support of ES6
(i)Javascript will not support ES6
(ii)Typescript will supports ES6
(4)strongly Type
(i)Javascript will not support strongly typed or statuc typing
(ii)Typescript supports strongly types or static typing feature
(5)OOPS Concept
(i)Javascript is just a scripting language
(ii)Typescript supports OOPS concepts like interfaces, classes, inheritance and generics etc.
(6)Optional Parameter
(i)Javascript have no such things like optional parameter.
(ii)Typescript has the optional parameter feature
(7)Modules
(i)Javascript will not support modules
(ii)Typescript will support modules.
(8)Variable Support
(i)Javascript NUMBER and strings are treated as objects
(ii)Typescript number and string are used by interface
(9)Generics
(i)In javascript we cannot have generics support
(ii)Typescript supports generics
(10)Compile
(i)JAVSCRIPT is interpreted language so it will produce error at runtime
(ii)On the other hand Typescript code and highlighted errors during the development time.

32.

Define what is TypeScript Map file?

Answer» DEFINE what is TypeScript Map file?
TypeScript Map files are source map files that let tools map between the emitted JavaScript code and the TypeScript source files that created it. And this files will helps to debug the Typescript file instead of the Javascript file. And this Typescript map file is consumed by MANY debuggers to debug the Typescript. A source map file maps from the transpiled JavaScript file to the original TypeScript file. Below are the some keypoints of TypeScript Map file:-
(1)Here reference to the JavaScript file is defined in a file FIELD.
(2)As from above point we knows the reference to TypeScript file is in a sources field. And it is placed in the PROJECT structure.
(3)In TypeScript file sourceRoot field is the root path of the TypeScript files.
(4)Here version field help us to get the version of the source map spec which is being used.
(5)The names field is a list of identifiers used in the source code that were changed or removed from the OUTPUT.
(6)There is mapping field have have mapping information for every position in the javascript code back to positions in the TypeScript code. These are base64 encoded variable-length quantities.
33.

TypeScript was made public by __________.

Answer»

TypeScript was made public by __________.
CHOOSE the correct OPTION from below LIST
(1)Sun
(2)Oracle
(3)MICROSOFT
(4)ECMA

Answer:-(3)Microsoft

34.

Typescript compiler tsc converts code to _________.

Answer»

Typescript COMPILER tsc converts code to _________.
CHOOSE the correct option from below list
(1)JavaScript
(2)AngularJS
(3)Assembly LANGUAGE
(4)Machine Language

Answer:-(1)JavaScript

35.

Which keyword is used for Inheritance in TypeScript?

Answer»

Which KEYWORD is used for Inheritance in TypeScript?
Choose the correct OPTION from below list
(1)EXTENDS
(2)defines
(3)follows
(4)implements

Answer:-(1)extends

36.

What does " function f(l: number, w: number){} " demonstrate?

Answer»

What does " function F(l: number, w: number){} " demonstrate?
Choose the correct option from below LIST
(1)Reassigning data type
(2)Namespace
(3)Modules
(4)Type ANNOTATION

Answer:-(4)Type annotation

37.

The code snippet " if (value && typeof value == "string") {}; is used for ______________.

Answer»

The code snippet " if (VALUE && typeof value == "string") {}; is used for ______________.
CHOOSE the correct OPTION from below list
(1)Overriding
(2)Overloading
(3)Paraeterising
(4)Inheritance add-on

Answer:-(2)Overloading