Total Questions : 40
Expected Time : 40 Minutes

1. What is TypeScript's 'generics' feature used for?

2. What is the TypeScript convention for naming variables?

3. Which data type represents a collection of values in TypeScript?

4. Which TypeScript feature allows you to work with a variable that could be of several different types?

5. Which of the following is the correct way to define an interface for a function in TypeScript?

6. What is the purpose of the 'extends' keyword in TypeScript?

7. Which TypeScript keyword is used to declare a constant?

8. How can you declare a variable that can either be a number or a null in TypeScript?

9. What does the 'is' keyword do in a TypeScript type predicate?

10. In TypeScript, what is the 'any' type used for?

11. In TypeScript, what is the purpose of the 'namespace' keyword?

12. What is TypeScript's 'module' system used for?

13. What is the TypeScript equivalent of 'undefined' in JavaScript?

14. What is TypeScript's 'tuple' data type used for?

15. What is the purpose of TypeScript's 'class' keyword?

16. In TypeScript, how do you define a tuple?

17. What is a discriminated union in TypeScript?

18. What is the purpose of TypeScript's 'import' statement?

19. How do you define an optional property in a TypeScript interface?

20. Which keyword is used to declare a constant variable in TypeScript?

21. In TypeScript, what is the difference between 'interface' and 'type' when defining a new type?

22. In TypeScript, how do you define an optional function parameter?

23. What is the TypeScript equivalent of 'console.log()' in JavaScript?

24. Which TypeScript keyword is used to indicate that a function doesn't return any value?

25. What is the purpose of the 'interface' keyword in TypeScript?

26. What does the 'as' keyword do in TypeScript?

27. Which TypeScript feature is used to apply metadata to classes, methods, or properties?

28. Which TypeScript feature is used to describe the shape of an object, including its properties and their types?

29. Which operator is used to specify a type guard in TypeScript?

30. How do you define a tuple type in TypeScript?

31. What is TypeScript's 'async/await' feature used for?

32. In TypeScript, what is the purpose of the 'as' keyword?

33. What is TypeScript's 'type inference'?

34. What is the purpose of the 'extends' keyword in generic constraints in TypeScript?

35. Which TypeScript feature is used to make a property or method in a class inaccessible from outside the class?

36. Which utility type constructs a type by picking the set of properties 'K' from 'T'?

37. What is the purpose of namespaces in TypeScript?

38. How do you declare a readonly array in TypeScript?

39. What is the purpose of TypeScript's 'enum'?

40. In TypeScript, what is the purpose of the 'try/catch' statement?