Prev Next

Web / Typescript interview questions

1. What is typescript?

TypeScript is an open-source programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript and adds optional static typing to the language....

Read full answer

2. Advantages of using typescript.

TypeScript is Object-oriented . TypeScript transpiler generates compilation error during transpiling unlike the JavaScript counterpart which is an interpreted language.

Read full answer

3. Who developed typescript?

Typescript developed and maintained by Microsoft .

Read full answer

4. Drawbacks of typescript.

Learning curve. Lack of package manager and dependency on npm.

Read full answer

5. Inbuilt datatypes in typescript.

Data type. Explanation....

Read full answer

6. What are the user-defined types in typescript?

Besides built-in data types, the user can also define his own data type using classes, interfaces, arrays, Enumerations (enum) and tuple.

Read full answer

7. Difference between Typescript and Javascript.

Typescript. Javascript.

Read full answer

8. Does typescript support abstract class?

No, typescript supports only class and interface.

Read full answer

9. Does JavaScript support modules like typescript?

No, JavaScript doesn't.

Read full answer

10. How do I install typescript in my computer?

TypeScript can be installed and managed via npm , the Node.js package manager. To install TypeScript, make sure that the npm is installed properly using the below command....

Read full answer

11. How do I compile typescript files?

Typescript files has the extension .ts . Use tsc <TypeScript File Name> command to compile a typescript file via command line....

Read full answer

12. What are Modules in Typescript?

A module is used to organize code written in TypeScript. Modules are of 2 types, Internal Modules (aka namespaces) and External Modules also referred just as modules simply.

Read full answer

13. Explain interface in typescript.

Interface is a structure that defines the contract/syntax for classes to follow. Classes that are derived from an interface must follow the structure....

Read full answer

14. Does typescript support all object oriented paradigm?

Yes, typescript supports encapsulation, inheritance, polymorphism and abstraction.

Read full answer

15. How do I compile typescript files automatically with changes to file in real-time?

Using -watch or -w compiler option, we can enable auto compilation. tsc -watch typescriptFile.ts This option executes the compiler in watch mode, watch input files, and trigger recompilation on changes.

Read full answer

16. What is class in typescript?

The concept of class is similar to Java, Scala or any other object oriented programming language. A Class can have constructor, member variables, properties and methods.

Read full answer

17. What is namespace in Typescript?

A namespace is a way to logically group related classes or interfaces in a wrapper. Namespaces are simply named JavaScript objects in the global namespace....

Read full answer

18. What does the question mark (?) on a typescript variable/parameter name denote?

Question mark on a typescript variable marks it as optional . Any optional parameters must follow required parameters....

Read full answer

19. What is debouncing?

Debouncing is a programming technique that enables us to defer the execution of a potentially-complex operation rather than executing it constantly/immediately. For example, While filtering large lists based on user input, rather than filtering on every keystroke, we can use...

Read full answer

20. What is the difference between Subject and BehaviorSubject?

A BehaviorSubject holds one value. When it is subscribed it emits the value immediately....

Read full answer

21. Dynamic vs Static Typing.

In dynamically typed languages, the types are associated with run-time values and not names explicitly in your code. Dynamic examples: JavaScript, Python, Ruby, PHP....

Read full answer

22. What is the Difference Between '!:' and '?:' in TypeScript object definitions?

The ? marks the property optional.

Read full answer

«
»

Comments & Discussions